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):
revert r30796. r30797 and r30798 are an alternative fix. [ruby-dev:43174] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
476ba90835
commit
e66eec9284
2 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Feb 5 22:01:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
|
||||
revert r30796. r30797 and r30798 are an alternative fix.
|
||||
[ruby-dev:43174]
|
||||
|
||||
Sat Feb 5 21:47:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (mlhs_basic): include mlhs_post for ripper. a patch
|
||||
|
|
|
@ -10,10 +10,13 @@ module Test
|
|||
obj.pretty_inspect.chomp
|
||||
end
|
||||
|
||||
def assert(test, msg = nil)
|
||||
UNASSIGNED = Object.new # :nodoc:
|
||||
|
||||
def assert(test, msg = UNASSIGNED)
|
||||
case msg
|
||||
when String, Proc, NilClass
|
||||
# do nothing
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue