summaryrefslogtreecommitdiff
path: root/test/ruby/test_complex.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-01 22:49:55 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-01 22:49:55 +0000
commit8b70a215ebb59961dff17a646831ae8801b1cca1 (patch)
tree534901c84a84a3923e4da8788ef1be16799f972d /test/ruby/test_complex.rb
parent5f90845420bd65be6926976a8a0dfd7a1b3173cf (diff)
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
Diffstat (limited to 'test/ruby/test_complex.rb')
-rw-r--r--test/ruby/test_complex.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb
index daf972f7b4..7c1418b2bf 100644
--- a/test/ruby/test_complex.rb
+++ b/test/ruby/test_complex.rb
@@ -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)