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

ruby-changes:34487

From: nobu <ko1@a...>
Date: Fri, 27 Jun 2014 03:25:20 +0900 (JST)
Subject: [ruby-changes:34487] nobu:r46568 (trunk): assertions.rb: refine message

nobu	2014-06-27 03:25:13 +0900 (Fri, 27 Jun 2014)

  New Revision: 46568

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

  Log:
    assertions.rb: refine message
    
    * test/lib/test/unit/assertions.rb (assert_raise_with_message):
      refine default message for the exception to be raised.

  Modified files:
    trunk/test/lib/test/unit/assertions.rb
Index: test/lib/test/unit/assertions.rb
===================================================================
--- test/lib/test/unit/assertions.rb	(revision 46567)
+++ test/lib/test/unit/assertions.rb	(revision 46568)
@@ -126,7 +126,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit/assertions.rb#L126
           raise TypeError, "Expected #{expected.inspect} to be a kind of String or Regexp, not #{expected.class}"
         end
 
-        ex = assert_raise(exception, *msg) {yield}
+        ex = assert_raise(exception, msg || proc {"Exception(#{exception}) with message matches to #{expected.inspect}"}) {yield}
         msg = message(msg, "") {"Expected Exception(#{exception}) was raised, but the message doesn't match"}
 
         if assert == :assert_equal

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

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