[前][次][番号順一覧][スレッド一覧]

ruby-changes:27587

From: nobu <ko1@a...>
Date: Fri, 8 Mar 2013 16:09:23 +0900 (JST)
Subject: [ruby-changes:27587] nobu:r39639 (trunk): assertions.rb: split lines

nobu	2013-03-08 16:09:14 +0900 (Fri, 08 Mar 2013)

  New Revision: 39639

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39639

  Log:
    assertions.rb: split lines
    
    * lib/test/unit/assertions.rb (Test::Unit::Assertions#message): split
      msg and default procs by period and newline.

  Modified files:
    trunk/lib/test/unit/assertions.rb

Index: lib/test/unit/assertions.rb
===================================================================
--- lib/test/unit/assertions.rb	(revision 39638)
+++ lib/test/unit/assertions.rb	(revision 39639)
@@ -322,7 +322,9 @@ EOT https://github.com/ruby/ruby/blob/trunk/lib/test/unit/assertions.rb#L322
 
       def message(msg = nil, *args, &default)
         if Proc === msg
-          super(nil, *args) {"#{msg.call}#{default.call if default}"}
+          super(nil, *args) do
+            [msg.call, (default.call if default)].compact.reject(&:empty?).join(".\n")
+          end
         else
           super
         end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]