diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-05 07:50:12 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-05 07:50:12 +0000 |
commit | 49f8799af4d612ea164f800645222d15cfc6ae02 (patch) | |
tree | ae2053fed2d87a5b4de437f1b04e70d10b3dde62 | |
parent | 8aa895294b8d696489b51a5e69b2986f452da905 (diff) |
* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
msg can be passed nil. [Bug #4371] [ruby-dev:43174]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/test/unit/assertions.rb | 9 |
2 files changed, 8 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Sat Feb 5 16:47:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): + msg can be passed nil. [Bug #4371] [ruby-dev:43174] + Sat Feb 5 15:18:25 2011 Eric Hodel <drbrain@segment7.net> * lib/rdoc: Upgrade to RDoc 3.5.2 diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index ce28042c49..69adcd61aa 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -10,13 +10,10 @@ module Test obj.pretty_inspect.chomp end - UNASSIGNED = Object.new # :nodoc: - - def assert(test, msg = UNASSIGNED) + def assert(test, msg = nil) case msg - when UNASSIGNED - msg = nil - when String, Proc + when String, Proc, NilClass + # do nothing 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 |