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

ruby-changes:31204

From: nobu <ko1@a...>
Date: Tue, 15 Oct 2013 04:14:19 +0900 (JST)
Subject: [ruby-changes:31204] nobu:r43283 (trunk): assertions.rb: ignore nil message

nobu	2013-10-15 04:14:13 +0900 (Tue, 15 Oct 2013)

  New Revision: 43283

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

  Log:
    assertions.rb: ignore nil message
    
    * lib/test/unit/assertions.rb (assert): allow nil message and just
      ignore.

  Modified files:
    trunk/lib/test/unit/assertions.rb
Index: lib/test/unit/assertions.rb
===================================================================
--- lib/test/unit/assertions.rb	(revision 43282)
+++ lib/test/unit/assertions.rb	(revision 43283)
@@ -27,6 +27,8 @@ module Test https://github.com/ruby/ruby/blob/trunk/lib/test/unit/assertions.rb#L27
       def assert(test, *msgs)
         case msg = msgs.first
         when String, Proc
+        when nil
+          msgs.shift
         else
           bt = caller.reject { |s| s.start_with?(MINI_DIR) }
           raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt

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

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