Skip to content

Commit

Permalink
Lint Generator: Remove generated test/spec files
Browse files Browse the repository at this point in the history
Follow-up to #1148

I noticed these tests did not fail even if `bin/rails standard` raised a
linting violation. Because the upcoming `suspenders:ci` generator will
run our linting tasks in CI, I felt having a test to do the same was no
longer warranted.
  • Loading branch information
stevepolitodesign committed Mar 21, 2024
1 parent f3f4480 commit 8aa6efb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 58 deletions.
6 changes: 0 additions & 6 deletions lib/generators/suspenders/lint_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ def configure_erb_lint
copy_file "config_initializers_better_html.rb", "config/initializers/better_html.rb"
copy_file "erblint.rake", "lib/tasks/erblint.rake"
template "rubocop.yml.tt", ".rubocop.yml"

if default_test_suite?
copy_file "better_html_test.rb", "test/views/better_html_test.rb"
elsif rspec_test_suite?
copy_file "better_html_spec.rb", "spec/views/better_html_spec.rb"
end
end

def update_package_json
Expand Down
17 changes: 0 additions & 17 deletions lib/generators/templates/lint/better_html_spec.rb

This file was deleted.

17 changes: 0 additions & 17 deletions lib/generators/templates/lint/better_html_test.rb

This file was deleted.

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

test "generates erb-lint tests" do
with_test_suite :minitest do
capture(:stderr) { run_generator }

assert_file app_root("test/views/better_html_test.rb")
assert_no_file app_root("spec/views/better_html_spec.rb")
end
end

test "generates erb-lint specs" do
with_test_suite :rspec do
capture(:stderr) { run_generator }

assert_file app_root("spec/views/better_html_spec.rb")
assert_no_file app_root("test/views/better_html_test.rb")
end
end

test "generates .rubocop.yml" do
expected_content = <<~YAML
AllCops:
Expand Down

0 comments on commit 8aa6efb

Please sign in to comment.