1
0
Fork 0
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:
nobu 2013-10-14 19:14:13 +00:00
parent 8e385d6778
commit f7b68ecfcf

View file

@ -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