提交 3564cd96 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Merge pull request #30832 from y-yagi/simplify_console_test

Simplify parse arguments in `ConsoleTest`
......@@ -172,21 +172,8 @@ def load_console
end
def parse_arguments(args)
Rails::Command::ConsoleCommand.class_eval do
alias_method :old_perform, :perform
define_method(:perform) do
extract_environment_option_from_argument
options
end
end
Rails::Command.invoke(:console, args)
ensure
Rails::Command::ConsoleCommand.class_eval do
undef_method :perform
alias_method :perform, :old_perform
undef_method :old_perform
end
command = Rails::Command::ConsoleCommand.new([], args)
command.send(:extract_environment_option_from_argument)
command.options
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册