From 8b70a215ebb59961dff17a646831ae8801b1cca1 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 1 Jan 2019 22:49:55 +0000 Subject: 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 --- test/ruby/test_complex.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') 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) -- cgit v1.2.3