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:
parent
5f90845420
commit
8b70a215eb
1 changed files with 3 additions and 0 deletions
|
@ -272,6 +272,7 @@ class Complex_Test < Test::Unit::TestCase
|
||||||
def test_add_with_redefining_int_plus
|
def test_add_with_redefining_int_plus
|
||||||
assert_in_out_err([], <<-'end;', ['true'], [])
|
assert_in_out_err([], <<-'end;', ['true'], [])
|
||||||
class Integer
|
class Integer
|
||||||
|
remove_method :+
|
||||||
def +(other); 42; end
|
def +(other); 42; end
|
||||||
end
|
end
|
||||||
a = Complex(1, 2) + Complex(0, 1)
|
a = Complex(1, 2) + Complex(0, 1)
|
||||||
|
@ -282,6 +283,7 @@ class Complex_Test < Test::Unit::TestCase
|
||||||
def test_add_with_redefining_float_plus
|
def test_add_with_redefining_float_plus
|
||||||
assert_in_out_err([], <<-'end;', ['true'], [])
|
assert_in_out_err([], <<-'end;', ['true'], [])
|
||||||
class Float
|
class Float
|
||||||
|
remove_method :+
|
||||||
def +(other); 42.0; end
|
def +(other); 42.0; end
|
||||||
end
|
end
|
||||||
a = Complex(1, 2.0) + Complex(0, 1)
|
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
|
def test_add_with_redefining_rational_plus
|
||||||
assert_in_out_err([], <<-'end;', ['true'], [])
|
assert_in_out_err([], <<-'end;', ['true'], [])
|
||||||
class Rational
|
class Rational
|
||||||
|
remove_method :+
|
||||||
def +(other); 355/113r; end
|
def +(other); 355/113r; end
|
||||||
end
|
end
|
||||||
a = Complex(1, 2r) + Complex(0, 1)
|
a = Complex(1, 2r) + Complex(0, 1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue