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:
parent
e1d1571256
commit
cb9ffb8d1c
2 changed files with 10 additions and 2 deletions
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue