From ddeb3ca1264f9d24df3bf855b6c9327e10d4e1a3 Mon Sep 17 00:00:00 2001 From: Nicholas Barone Date: Thu, 8 Aug 2024 14:14:10 -0700 Subject: [PATCH] Fix tests & run linter --- lib/generators/storybook/example_generator.rb | 2 +- lib/generators/storybook/install_generator.rb | 6 +++--- lib/storybook/version.rb | 1 - rails-storybook.gemspec | 2 +- spec/rails/storybook_spec.rb | 8 +++----- spec/spec_helper.rb | 2 +- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/generators/storybook/example_generator.rb b/lib/generators/storybook/example_generator.rb index 208a14d..eea8ae7 100644 --- a/lib/generators/storybook/example_generator.rb +++ b/lib/generators/storybook/example_generator.rb @@ -1,4 +1,4 @@ -require 'rails/generators' +require "rails/generators" class Storybook::ExampleGenerator < Rails::Generators::Base def install_view_components diff --git a/lib/generators/storybook/install_generator.rb b/lib/generators/storybook/install_generator.rb index af5ae86..c8371f6 100644 --- a/lib/generators/storybook/install_generator.rb +++ b/lib/generators/storybook/install_generator.rb @@ -1,4 +1,4 @@ -require 'rails/generators' +require "rails/generators" class Storybook::InstallGenerator < Rails::Generators::Base def install_storybook @@ -45,8 +45,8 @@ def create_storybook_layout_slim def update_storybook # Main.js insert_into_file ".storybook/main.js", "\n \"@storybook/server\",", after: "addons: [" - gsub_file '.storybook/main.js', "*.stories.@(js|jsx|mjs|ts|tsx)", "*.stories.@(js|jsx|mjs|ts|tsx|json)" - gsub_file '.storybook/main.js', "@storybook/react-webpack5", "@storybook/server-webpack5" + gsub_file ".storybook/main.js", "*.stories.@(js|jsx|mjs|ts|tsx)", "*.stories.@(js|jsx|mjs|ts|tsx|json)" + gsub_file ".storybook/main.js", "@storybook/react-webpack5", "@storybook/server-webpack5" # Preview.js base_url = "http://localhost:3000/rails/view_components" diff --git a/lib/storybook/version.rb b/lib/storybook/version.rb index 85ae36c..fc220bc 100644 --- a/lib/storybook/version.rb +++ b/lib/storybook/version.rb @@ -2,4 +2,3 @@ module Storybook VERSION = "0.1.0" end - diff --git a/rails-storybook.gemspec b/rails-storybook.gemspec index c76076b..bf85986 100644 --- a/rails-storybook.gemspec +++ b/rails-storybook.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = [ "lib" ] - + spec.add_dependency "rails", "~> 7.0" spec.add_dependency "slim", "~> 5.2" spec.add_development_dependency "rails", "~> 7.0" diff --git a/spec/rails/storybook_spec.rb b/spec/rails/storybook_spec.rb index 599d773..25c8273 100644 --- a/spec/rails/storybook_spec.rb +++ b/spec/rails/storybook_spec.rb @@ -1,9 +1,7 @@ -RSpec.describe Rails::Storybook do +RSpec.describe Storybook do it "has a version number" do - expect(Rails::Storybook::VERSION).not_to be nil + expect(Storybook::VERSION).not_to be nil end - it "does something useful" do - expect(false).to eq(true) - end + it "has meaningful tests" end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4afc294..843d176 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,5 @@ require "bundler/setup" -require "rails/storybook" +require "storybook" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure