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

ruby-changes:64343

From: Kenta <ko1@a...>
Date: Sat, 19 Dec 2020 22:14:42 +0900 (JST)
Subject: [ruby-changes:64343] 8355a3e17b (master): [bigdecimal] Fix deprecation warning test

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

From 8355a3e17b6ea05ee60400ae41a1553eee900ed8 Mon Sep 17 00:00:00 2001
From: Kenta Murata <mrkn@m...>
Date: Sat, 19 Dec 2020 21:13:33 +0900
Subject: [bigdecimal] Fix deprecation warning test


diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index 445a3f2..16f5505 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -611,9 +611,13 @@ class TestBigDecimal < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/bigdecimal/test_bigdecimal.rb#L611
   end
 
   def test_precs_deprecated
+    saved = Warning[:deprecated]
+    Warning[:deprecated] = true
     assert_warn(/BigDecimal#precs is deprecated and will be removed in the future/) do
       BigDecimal("1").precs
     end
+  ensure
+    Warning[:deprecated] = saved
   end
 
   def test_precs
-- 
cgit v0.10.2


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

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