1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add --stdout-on-failure, the reverse of --stderr-on-failure

This commit is contained in:
Nobuyoshi Nakada 2022-07-05 09:37:17 +09:00
parent 1b34bd07c1
commit 5921bfc7ce
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -1182,15 +1182,20 @@ module Test
def setup_options(parser, options)
super
parser.separator "output options:"
options[:failed_output] = $stdout
parser.on '--stderr-on-failure', 'Use stderr to print failure messages' do
options[:stderr_on_failure] = true
options[:failed_output] = $stderr
end
parser.on '--stdout-on-failure', 'Use stdout to print failure messages', '(default)' do
options[:failed_output] = $stdout
end
end
def process_args(args = [])
return @options if @options
options = super
@failed_output = options[:stderr_on_failure] ? $stderr : $stdout
@failed_output = options[:failed_output]
options
end
end