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

ruby-changes:55998

From: Nobuyoshi <ko1@a...>
Date: Tue, 4 Jun 2019 19:04:40 +0900 (JST)
Subject: [ruby-changes:55998] Nobuyoshi Nakada: 9e472e18d2 (trunk): suppress marshal warnings

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

From 9e472e18d22d013f5da7d5a3769599c5fb763f43 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 4 Jun 2019 19:00:48 +0900
Subject: suppress marshal warnings


diff --git a/test/date/test_switch_hitter.rb b/test/date/test_switch_hitter.rb
index 4693cbd..6c587d8 100644
--- a/test/date/test_switch_hitter.rb
+++ b/test/date/test_switch_hitter.rb
@@ -530,14 +530,14 @@ class TestSH < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/date/test_switch_hitter.rb#L530
 
   def test_marshal14
     s = "\x04\x03u:\x01\x04Date\x01\v\x04\x03[\x01\x02i\x03\xE8i%T"
-    d = Marshal.load(s)
+    d = suppress_warning {Marshal.load(s)}
     assert_equal(Rational(4903887,2), d.ajd)
     assert_equal(Date::GREGORIAN, d.start)
   end
 
   def test_marshal16
     s = "\x04\x06u:\tDate\x0F\x04\x06[\ai\x03\xE8i%T"
-    d = Marshal.load(s)
+    d = suppress_warning {Marshal.load(s)}
     assert_equal(Rational(4903887,2), d.ajd)
     assert_equal(Date::GREGORIAN, d.start)
   end
@@ -655,4 +655,12 @@ class TestSH < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/date/test_switch_hitter.rb#L655
     assert_equal(true, Date.test_all)
   end if defined?(Date.test_all)
 
+  private
+
+  def suppress_warning
+    $VERBOSE, verbose = nil, $VERBOSE
+    yield
+  ensure
+    $VERBOSE = verbose
+  end
 end
-- 
cgit v0.10.2


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

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