ruby-changes:17550
From: nobu <ko1@a...>
Date: Fri, 22 Oct 2010 14:51:50 +0900 (JST)
Subject: [ruby-changes:17550] Ruby:r29555 (trunk): * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
nobu 2010-10-22 14:50:17 +0900 (Fri, 22 Oct 2010) New Revision: 29555 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29555 Log: * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): assertion message must not be nil. Modified files: trunk/ChangeLog trunk/lib/test/unit/assertions.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 29554) +++ ChangeLog (revision 29555) @@ -1,3 +1,8 @@ +Fri Oct 22 14:50:13 2010 Nobuyoshi Nakada <nobu@r...> + + * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): + assertion message must not be nil. + Fri Oct 22 13:59:50 2010 NARUSE, Yui <naruse@r...> * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): Index: lib/test/unit/assertions.rb =================================================================== --- lib/test/unit/assertions.rb (revision 29554) +++ lib/test/unit/assertions.rb (revision 29555) @@ -13,8 +13,11 @@ UNASSIGNED = Object.new # :nodoc: def assert(test, msg = UNASSIGNED) - msg = nil if msg == UNASSIGNED - unless String === msg or Proc === msg or msg.nil? then + case msg + when UNASSIGNED + msg = nil + when String, Proc + else bt = caller.reject { |s| s.rindex(MiniTest::MINI_DIR, 0) } raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/