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

suppress warning: method redefined; discarding old + introduced at r66681

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2019-01-01 22:49:55 +00:00
parent 5f90845420
commit 8b70a215eb

View file

@ -272,6 +272,7 @@ class Complex_Test < Test::Unit::TestCase
def test_add_with_redefining_int_plus
assert_in_out_err([], <<-'end;', ['true'], [])
class Integer
remove_method :+
def +(other); 42; end
end
a = Complex(1, 2) + Complex(0, 1)
@ -282,6 +283,7 @@ class Complex_Test < Test::Unit::TestCase
def test_add_with_redefining_float_plus
assert_in_out_err([], <<-'end;', ['true'], [])
class Float
remove_method :+
def +(other); 42.0; end
end
a = Complex(1, 2.0) + Complex(0, 1)
@ -292,6 +294,7 @@ class Complex_Test < Test::Unit::TestCase
def test_add_with_redefining_rational_plus
assert_in_out_err([], <<-'end;', ['true'], [])
class Rational
remove_method :+
def +(other); 355/113r; end
end
a = Complex(1, 2r) + Complex(0, 1)