Skip to content

Commit

Permalink
Update generator descriptions
Browse files Browse the repository at this point in the history
Follow-up to #1187.

Removes description tests. These were a helpful guide during
development, but don't provide much value now.
  • Loading branch information
stevepolitodesign committed Apr 13, 2024
1 parent 08be1dd commit eca36bb
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 91 deletions.
6 changes: 0 additions & 6 deletions test/generators/suspenders/accessibility_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ class AccessibilityGeneratorTest < Rails::Generators::TestCase
end
end

test "generator has a description" do
description = "Installs capybara_accessibility_audit and capybara_accessible_selectors"

assert_match description, Suspenders::Generators::AccessibilityGenerator.desc
end

private

def prepare_destination
Expand Down
11 changes: 0 additions & 11 deletions test/generators/suspenders/advisories_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ class AdvisoriesGeneratorTest < Rails::Generators::TestCase
assert_match(/bundle install/, output)
end

test "generator has a description" do
description = <<~TEXT
Show security advisories during development.
Uses the `bundler-audit` gem to update the local security database and
show any relevant issues with the app's dependencies via a Rake task.
TEXT

assert_equal description, Suspenders::Generators::AdvisoriesGenerator.desc
end

test "modifies Rakefile" do
touch "Rakefile", content: <<~TEXT
require_relative "config/application"
Expand Down
4 changes: 0 additions & 4 deletions test/generators/suspenders/email_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ class EmailGeneratorTest < Rails::Generators::TestCase
assert_file app_root("config/environments/test.rb"), /config\.action_mailer\.default_url_options\s*=\s*{\s*host:\s*"www\.example\.com"\s*}/
end

test "has custom description" do
assert_no_match(/Description/, generator_class.desc)
end

private

def prepare_destination
Expand Down
19 changes: 0 additions & 19 deletions test/generators/suspenders/factories_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,6 @@ class FactoriesGenerator::DefaultTest < Rails::Generators::TestCase
setup :prepare_destination
teardown :restore_destination

test "generator has a description" do
description = <<~TEXT
Build test data with clarity and ease.
This uses FactoryBot to help you define dummy and test data for your test
suite. The `create`, `build`, and `build_stubbed` class methods are directly
available to all tests.
We recommend putting FactoryBot definitions in one `spec/factories.rb` (or
`test/factories`) file, at least until it grows unwieldy. This helps reduce
confusion around circular dependencies and makes it easy to jump between
definitions.
Supports the default test suite and RSpec.
TEXT

assert_equal description, FactoriesGenerator.desc
end

test "installs gem with Bundler" do
Bundler.stubs(:with_unbundled_env).yields
generator.expects(:run).with("bundle install").once
Expand Down
6 changes: 0 additions & 6 deletions test/generators/suspenders/inline_svg_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ class InlinveSvgGeneratorTest < Rails::Generators::TestCase
end
end

test "generator has a description" do
description = "Render SVG images inline, as a potential performance improvement for the viewer."

assert_match description, Suspenders::Generators::InlineSvgGenerator.desc
end

test "configures raising an error when an SVG file is not found" do
expected_configuration = file_fixture("inline_svg.rb").read

Expand Down
6 changes: 0 additions & 6 deletions test/generators/suspenders/jobs_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ class JobsGeneratorTest < Rails::Generators::TestCase
assert_match(/bundle install/, output)
end

test "generator has a description" do
description = "Installs Sidekiq for background job processing."

assert_match description, Suspenders::Generators::JobsGenerator.desc
end

test "configures ActiveJob logging" do
expected_configuration = file_fixture("active_job.rb").read

Expand Down
6 changes: 0 additions & 6 deletions test/generators/suspenders/lint_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@ class LintGeneratorTest < Rails::Generators::TestCase
end
end

test "description" do
desc = "Creates a holistic linting solution that covers JavaScript, CSS, Ruby and ERB."

assert_match desc, generator_class.desc
end

test "created package.json if one does not exist" do
remove_file_if_exists "package.json"

Expand Down
4 changes: 0 additions & 4 deletions test/generators/suspenders/prerequisites_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ class PrerequisitesGeneratorTest < Rails::Generators::TestCase
end
end

test "has custom description" do
assert_no_match(/Description/, generator.class.desc)
end

private

def restore_destination
Expand Down
9 changes: 0 additions & 9 deletions test/generators/suspenders/rake_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ class RakeGeneratorTest < Rails::Generators::TestCase
end
end

test "generator has a description" do
description = <<~TEXT
Configures the default Rake task to audit and lint the codebase with
`bundler-audit` and `standard`, in addition to running the test suite.
TEXT

assert_equal description, generator_class.desc
end

private

def prepare_destination
Expand Down
4 changes: 0 additions & 4 deletions test/generators/suspenders/setup_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ class SetupGeneratorTest < Rails::Generators::TestCase
end
end

test "has a custom description" do
assert_no_match(/Description:/, generator_class.desc)
end

private

def prepare_destination
Expand Down
4 changes: 0 additions & 4 deletions test/generators/suspenders/styles_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ class StylesGeneratorTest < Rails::Generators::TestCase
end
end

test "generator has a custom description" do
assert_no_match(/Description/, generator_class.desc)
end

private

def prepare_destination
Expand Down
4 changes: 0 additions & 4 deletions test/generators/suspenders/tasks_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ class TasksGeneratorTest < Rails::Generators::TestCase
assert_no_file app_root("lib/tasks/dev.rake")
end

test "has a custom description" do
assert_no_match(/Description:/, generator_class.desc)
end

private

def dev_rake
Expand Down
4 changes: 0 additions & 4 deletions test/generators/suspenders/testing_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ class TestingGeneratorTest < Rails::Generators::TestCase
end
end

test "has custom description" do
assert_no_match(/Description/, generator_class.desc)
end

private

def prepare_destination
Expand Down
4 changes: 0 additions & 4 deletions test/generators/suspenders/views_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ class ViewsGeneratorTest < Rails::Generators::TestCase
end
end

test "has a custom description" do
assert_no_match(/Description:\n/, generator_class.desc)
end

test "disables InstantClick" do
run_generator

Expand Down

0 comments on commit eca36bb

Please sign in to comment.