1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):

assertion message must not be nil.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-10-22 05:50:17 +00:00
parent e1d1571256
commit cb9ffb8d1c
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Fri Oct 22 14:50:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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@ruby-lang.org>
* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):

View file

@ -13,8 +13,11 @@ module Test
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