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

refactoring btest output

don't duplicate the message, but prepare `out` var to choose
stdout/err.
This commit is contained in:
Koichi Sasada 2022-01-26 01:51:16 +09:00
parent cac6fe9023
commit e953d68657
Notes: git 2022-01-26 09:56:50 +09:00

View file

@ -213,15 +213,14 @@ def exec_test(pathes)
@errbuf.each do |msg|
$stderr.puts msg
end
out = @quiet ? $stdout : $stderr
if @error == 0
if @count == 0
$stderr.puts "No tests, no problem" unless @quiet
out.puts "No tests, no problem" unless @quiet
else
if @quiet
$stdout.puts "#{@passed}PASS#{@reset} all #{@count} tests"
else
$stderr.puts "#{@passed}PASS#{@reset} all #{@count} tests"
end
out.puts "#{@passed}PASS#{@reset} all #{@count} tests"
end
exit true
else