From cc680846529b1bb00cded40705e0de696f78b0f9 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 30 Jun 2019 09:55:50 +0900 Subject: [PATCH] Suppress method redefinition warnings --- test/ruby/test_iseq.rb | 3 ++- test/test_prime.rb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index f10a6659ba..b4d44e5f28 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -464,12 +464,13 @@ class TestISeq < Test::Unit::TestCase RUBY iseq_bin = iseq.to_binary + iseq = ISeq.load_from_binary(iseq_bin) lines = [] TracePoint.new(tracepoint_type){|tp| next unless tp.path == filename lines << tp.lineno }.enable{ - ISeq.load_from_binary(iseq_bin).eval + EnvUtil.suppress_warning {iseq.eval} } lines diff --git a/test/test_prime.rb b/test/test_prime.rb index 3e5997fcdf..9db13f08fe 100644 --- a/test/test_prime.rb +++ b/test/test_prime.rb @@ -269,6 +269,7 @@ class TestPrime < Test::Unit::TestCase end ensure class << Integer + remove_method :sqrt alias_method :sqrt, :org_sqrt remove_method :org_sqrt end