ruby-changes:23566
From: nobu <ko1@a...>
Date: Fri, 11 May 2012 09:51:22 +0900 (JST)
Subject: [ruby-changes:23566] nobu:r35617 (trunk): lib/test/unit.rb: no unnecessary newlines
nobu 2012-05-11 09:51:10 +0900 (Fri, 11 May 2012) New Revision: 35617 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35617 Log: lib/test/unit.rb: no unnecessary newlines * lib/test/unit.rb (Test::Unit::Runner#failed): no unnecessary newlines if no reports to be displayed. Modified files: trunk/ChangeLog trunk/lib/test/unit.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 35616) +++ ChangeLog (revision 35617) @@ -1,3 +1,8 @@ +Fri May 11 09:51:07 2012 Nobuyoshi Nakada <nobu@r...> + + * lib/test/unit.rb (Test::Unit::Runner#failed): no unnecessary + newlines if no reports to be displayed. + Thu May 11 03:41:00 2012 Kenta Murata <mrkn@m...> * ext/bigdecimal/bigdecimal.c: use RB_GC_GUARD. [ruby-dev:45627] Index: lib/test/unit.rb =================================================================== --- lib/test/unit.rb (revision 35616) +++ lib/test/unit.rb (revision 35617) @@ -685,12 +685,15 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/