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:
parent
c400795c8c
commit
b3ee43bb6e
1 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue