[前][次][番号順一覧][スレッド一覧]

ruby-changes:56289

From: Nobuyoshi <ko1@a...>
Date: Sun, 30 Jun 2019 18:53:53 +0900 (JST)
Subject: [ruby-changes:56289] Nobuyoshi Nakada: cc68084652 (trunk): Suppress method redefinition warnings

https://git.ruby-lang.org/ruby.git/commit/?id=cc68084652

From cc680846529b1bb00cded40705e0de696f78b0f9 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 30 Jun 2019 09:55:50 +0900
Subject: Suppress method redefinition warnings


diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index f10a665..b4d44e5 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -464,12 +464,13 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L464
     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 3e5997f..9db13f0 100644
--- a/test/test_prime.rb
+++ b/test/test_prime.rb
@@ -269,6 +269,7 @@ class TestPrime < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_prime.rb#L269
       end
     ensure
       class << Integer
+        remove_method :sqrt
         alias_method :sqrt, :org_sqrt
         remove_method :org_sqrt
       end
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]