mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
unit.rb: no UNDEFINED
* test/lib/minitest/unit.rb (UNDEFINED): remove. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8d7f655261
commit
8a57298c09
1 changed files with 4 additions and 10 deletions
|
@ -73,12 +73,6 @@ module MiniTest
|
||||||
# printed if the assertion fails.
|
# printed if the assertion fails.
|
||||||
|
|
||||||
module Assertions
|
module Assertions
|
||||||
UNDEFINED = Object.new # :nodoc:
|
|
||||||
|
|
||||||
def UNDEFINED.inspect # :nodoc:
|
|
||||||
"UNDEFINED" # again with the rdoc bugs... :(
|
|
||||||
end
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Returns the diff command to use in #diff. Tries to intelligently
|
# Returns the diff command to use in #diff. Tries to intelligently
|
||||||
# figure out what diff to use.
|
# figure out what diff to use.
|
||||||
|
@ -311,8 +305,8 @@ module MiniTest
|
||||||
#
|
#
|
||||||
# assert_operator 5, :<=, 4
|
# assert_operator 5, :<=, 4
|
||||||
|
|
||||||
def assert_operator o1, op, o2 = UNDEFINED, msg = nil
|
def assert_operator o1, op, o2 = (predicate = true; nil), msg = nil
|
||||||
return assert_predicate o1, op, msg if UNDEFINED == o2
|
return assert_predicate o1, op, msg if predicate
|
||||||
msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op} #{mu_pp(o2)}" }
|
msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op} #{mu_pp(o2)}" }
|
||||||
assert o1.__send__(op, o2), msg
|
assert o1.__send__(op, o2), msg
|
||||||
end
|
end
|
||||||
|
@ -676,8 +670,8 @@ module MiniTest
|
||||||
# refute_operator 1, :>, 2 #=> pass
|
# refute_operator 1, :>, 2 #=> pass
|
||||||
# refute_operator 1, :<, 2 #=> fail
|
# refute_operator 1, :<, 2 #=> fail
|
||||||
|
|
||||||
def refute_operator o1, op, o2 = UNDEFINED, msg = nil
|
def refute_operator o1, op, o2 = (predicate = true; nil), msg = nil
|
||||||
return refute_predicate o1, op, msg if UNDEFINED == o2
|
return refute_predicate o1, op, msg if predicate
|
||||||
msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op} #{mu_pp(o2)}"}
|
msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op} #{mu_pp(o2)}"}
|
||||||
refute o1.__send__(op, o2), msg
|
refute o1.__send__(op, o2), msg
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue