Skip to content

Commit

Permalink
Modify suspenders:styles (#1146)
Browse files Browse the repository at this point in the history
These modifications were not captured before merging the #1145,
presumably because of an issue with GitHub CLI.
  • Loading branch information
stevepolitodesign committed May 10, 2024
1 parent d8cf034 commit bb3fa56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ Configures applications to use [PostCSS][] or [Tailwind][] via
[cssbundling-rails][]. Defaults to PostCSS with [modern-normalize][], with the
option to override via `--css=tailwind`.

Also creates a directory structure to store additional stylesheets if using
PostCSS.
Also creates additional stylesheets if using PostCSS.

`bin/rails g suspenders:styles --css[postcss:tailwind]`

Expand Down
3 changes: 1 addition & 2 deletions lib/generators/suspenders/styles_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class StylesGenerator < Rails::Generators::Base
Defaults to PostCSS with modern-normalize, with the option to override via
--css=tailwind.
Also creates a directory structure to store additional stylesheets if using
PostCSS.
Also creates additional stylesheets if using PostCSS.
TEXT

def add_cssbundling_rails_gem
Expand Down
11 changes: 5 additions & 6 deletions test/generators/suspenders/styles_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class StylesGenerator::DefaultTest < Rails::Generators::TestCase
Defaults to PostCSS with modern-normalize, with the option to override via
--css=tailwind.
Also creates a directory structure to store additional stylesheets if using
PostCSS.
Also creates additional stylesheets if using PostCSS.
TEXT

assert_equal description, generator_class.desc
Expand Down Expand Up @@ -130,13 +129,13 @@ class StylesGenerator::TailwindTest < Rails::Generators::TestCase
assert_match(/bin\/rails css:install:tailwind/, output)
end

test "does not install normalize" do
test "does not install modern-normalize" do
output = run_generator %w[--css=tailwind]

assert_no_match(/add.*modern-normalize/, output)
end

test "does not create directory structure" do
test "does not create stylesheets" do
run_generator %w[--css=tailwind]

assert_no_file app_root("app/assets/stylesheets/base.css")
Expand Down Expand Up @@ -168,7 +167,7 @@ class StylesGenerator::PostCssTest < Rails::Generators::TestCase
setup :prepare_destination
teardown :restore_destination

test "installs normalize and imports style sheets" do
test "installs modern-normalize and imports stylesheets" do
output = run_generator %w[--css=postcss]
application_stylesheet = <<~TEXT
@import "modern-normalize";
Expand All @@ -184,7 +183,7 @@ class StylesGenerator::PostCssTest < Rails::Generators::TestCase
end
end

test "creates directory structure" do
test "creates stylesheets" do
run_generator

assert_file app_root("app/assets/stylesheets/base.css")
Expand Down

0 comments on commit bb3fa56

Please sign in to comment.