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):
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
This commit is contained in:
parent
8aa895294b
commit
49f8799af4
2 changed files with 8 additions and 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>
|
Sat Feb 5 15:18:25 2011 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/rdoc: Upgrade to RDoc 3.5.2
|
* lib/rdoc: Upgrade to RDoc 3.5.2
|
||||||
|
|
|
@ -10,13 +10,10 @@ module Test
|
||||||
obj.pretty_inspect.chomp
|
obj.pretty_inspect.chomp
|
||||||
end
|
end
|
||||||
|
|
||||||
UNASSIGNED = Object.new # :nodoc:
|
def assert(test, msg = nil)
|
||||||
|
|
||||||
def assert(test, msg = UNASSIGNED)
|
|
||||||
case msg
|
case msg
|
||||||
when UNASSIGNED
|
when String, Proc, NilClass
|
||||||
msg = nil
|
# do nothing
|
||||||
when String, Proc
|
|
||||||
else
|
else
|
||||||
bt = caller.reject { |s| s.rindex(MiniTest::MINI_DIR, 0) }
|
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
|
raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt
|
||||||
|
|
Loading…
Reference in a new issue