1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Cleaned up clevar in test/unit's override of assert

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ryan 2010-10-21 21:15:06 +00:00
parent c400795c8c
commit b3ee43bb6e

View file

@ -10,10 +10,12 @@ module Test
obj.pretty_inspect.chomp
end
def assert(test, msg = (nomsg = true; nil))
unless nomsg or msg.instance_of?(String) or msg.instance_of?(Proc) or
(bt = caller).first.rindex(MiniTest::MINI_DIR, 0)
bt.delete_if {|s| s.rindex(MiniTest::MINI_DIR, 0)}
UNASSIGNED = Object.new # :nodoc:
def assert(test, msg = UNASSIGNED)
msg = nil if msg == UNASSIGNED
unless String === msg or Proc === msg then
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
super