Skip to content

Commit 1241247

Browse files
authored
Merge pull request rails#53384 from eval/issue/test-unit-generators
Hide test_unit generators when using other test framework
2 parents e946233 + 00761d5 commit 1241247

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

railties/lib/rails/generators.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ def hidden_namespaces
157157
"action_text:install",
158158
"action_mailbox:install",
159159
"devcontainer"
160-
]
160+
].tap do |h|
161+
h << "test_unit" if test.to_s != "test_unit"
162+
end
161163
end
162164
end
163165

railties/test/application/generators_test.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,15 @@ def check_expected
205205
end
206206
end
207207

208+
test "help hides test_unit when using another test_framework" do
209+
add_to_config <<-RUBY
210+
config.generators.test_framework :rspec
211+
RUBY
212+
213+
output = rails("generate", "--help")
214+
assert_no_match "test_unit", output
215+
end
216+
208217
test "skip collision check" do
209218
rails("generate", "model", "post", "title:string")
210219

0 commit comments

Comments
 (0)