ruby-changes:18774
From: kosaki <ko1@a...>
Date: Sat, 5 Feb 2011 22:13:35 +0900 (JST)
Subject: [ruby-changes:18774] Ruby:r30800 (trunk): * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
kosaki 2011-02-05 22:06:14 +0900 (Sat, 05 Feb 2011) New Revision: 30800 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30800 Log: * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): revert r30796. r30797 and r30798 are an alternative fix. [ruby-dev:43174] Modified files: trunk/ChangeLog trunk/lib/test/unit/assertions.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 30799) +++ ChangeLog (revision 30800) @@ -1,3 +1,9 @@ +Sat Feb 5 22:01:59 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): + revert r30796. r30797 and r30798 are an alternative fix. + [ruby-dev:43174] + Sat Feb 5 21:47:09 2011 Nobuyoshi Nakada <nobu@r...> * parse.y (mlhs_basic): include mlhs_post for ripper. a patch Index: lib/test/unit/assertions.rb =================================================================== --- lib/test/unit/assertions.rb (revision 30799) +++ lib/test/unit/assertions.rb (revision 30800) @@ -10,10 +10,13 @@ obj.pretty_inspect.chomp end - def assert(test, msg = nil) + UNASSIGNED = Object.new # :nodoc: + + def assert(test, msg = UNASSIGNED) case msg - when String, Proc, NilClass - # do nothing + 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/