1
0
Fork 0
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:
nobu 2015-01-04 02:04:26 +00:00
parent 8d7f655261
commit 8a57298c09

View file

@ -73,12 +73,6 @@ module MiniTest
# printed if the assertion fails.
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
# figure out what diff to use.
@ -311,8 +305,8 @@ module MiniTest
#
# assert_operator 5, :<=, 4
def assert_operator o1, op, o2 = UNDEFINED, msg = nil
return assert_predicate o1, op, msg if UNDEFINED == o2
def assert_operator o1, op, o2 = (predicate = true; nil), msg = nil
return assert_predicate o1, op, msg if predicate
msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op} #{mu_pp(o2)}" }
assert o1.__send__(op, o2), msg
end
@ -676,8 +670,8 @@ module MiniTest
# refute_operator 1, :>, 2 #=> pass
# refute_operator 1, :<, 2 #=> fail
def refute_operator o1, op, o2 = UNDEFINED, msg = nil
return refute_predicate o1, op, msg if UNDEFINED == o2
def refute_operator o1, op, o2 = (predicate = true; nil), msg = nil
return refute_predicate o1, op, msg if predicate
msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op} #{mu_pp(o2)}"}
refute o1.__send__(op, o2), msg
end