From 1c897f500e0ec995c3ae0685966813ac2811bfb7 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Thu, 23 Feb 2017 18:30:49 +0100 Subject: Fix test:units not hitting rake task. By splitting the namespace test:units on :, we'd find our TestCommand, which knew nothing of a units method. So check that a found command also includes the command name we're trying to call. --- railties/lib/rails/command.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/command.rb b/railties/lib/rails/command.rb index 73f9684ca4..d8549db62e 100644 --- a/railties/lib/rails/command.rb +++ b/railties/lib/rails/command.rb @@ -39,7 +39,8 @@ module Rails command_name = "help" if command_name.blank? || HELP_MAPPINGS.include?(command_name) namespace = "version" if %w( -v --version ).include?(command_name) - if command = find_by_namespace(namespace, command_name) + command = find_by_namespace(namespace, command_name) + if command && command.all_commands[command_name] command.perform(command_name, args, config) else find_by_namespace("rake").perform(full_namespace, args, config) -- cgit v1.2.3