mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
assertions.rb: ignore nil message
* lib/test/unit/assertions.rb (assert): allow nil message and just ignore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8e385d6778
commit
f7b68ecfcf
1 changed files with 2 additions and 0 deletions
|
@ -27,6 +27,8 @@ module Test
|
|||
def assert(test, *msgs)
|
||||
case msg = msgs.first
|
||||
when String, Proc
|
||||
when nil
|
||||
msgs.shift
|
||||
else
|
||||
bt = caller.reject { |s| s.start_with?(MINI_DIR) }
|
||||
raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt
|
||||
|
|
Loading…
Add table
Reference in a new issue