Hide rails:all from rails help

It's already listed as a Rake task.
This commit is contained in:
Étienne Barrié 2022-01-07 13:50:59 +01:00
parent 3d52212a0c
commit a627ef47ea
3 changed files with 12 additions and 1 deletions

View File

@ -161,7 +161,8 @@ module Rails
end
def namespaced_commands
commands.keys.map do |key|
commands.filter_map do |key, command|
next if command.hidden?
if command_root_namespace.match?(/(\A|:)#{key}\z/)
command_root_namespace
else

View File

@ -42,6 +42,7 @@ module Rails
end
end
desc "test:all", "Runs all tests, including system tests", hide: true
def all
self.args = ["test/**/*_test.rb"]
perform

View File

@ -13,6 +13,15 @@ class Rails::Command::BaseTest < ActiveSupport::TestCase
assert_equal %w(db:system:change), Rails::Command::Db::System::ChangeCommand.printing_commands
end
test "printing commands hides hidden commands" do
class Rails::Command::HiddenCommand < Rails::Command::Base
desc "command", "Hidden command", hide: true
def command
end
end
assert_equal [], Rails::Command::HiddenCommand.printing_commands
end
test "ARGV is populated" do
class Rails::Command::ArgvCommand < Rails::Command::Base
def check_populated(*args)