summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-11 00:51:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-11 00:51:10 +0000
commit5f58cd09062f2c22f776e62ad5e0c4d28e4e8969 (patch)
tree52ad8779b09b91167682434158f26ab4bbc20fe5 /lib
parentc8b35283832e157e4d4d7f78cc04783f420de542 (diff)
lib/test/unit.rb: no unnecessary newlines
* lib/test/unit.rb (Test::Unit::Runner#failed): no unnecessary newlines if no reports to be displayed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/test/unit.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index ed465e97a6..f826492f05 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -685,12 +685,15 @@ module Test
def succeed; del_status_line; end
def failed(s)
- $stdout.puts
+ sep = "\n"
@report_count ||= 0
report.each do |msg|
next if @options[:hide_skip] and msg.start_with? "Skipped:"
msg = msg.split(/$/, 2)
- $stdout.puts "#{@failed_color}%3d) %s#{@reset_color}%s\n" % [@report_count += 1, *msg]
+ $stdout.printf("%s%s%3d) %s%s%s\n",
+ sep, @failed_color, @report_count += 1,
+ msg[0], @reset_color, msg[1])
+ sep = nil
end
report.clear
end