From 8355a3e17b6ea05ee60400ae41a1553eee900ed8 Mon Sep 17 00:00:00 2001 From: Kenta Murata Date: Sat, 19 Dec 2020 21:13:33 +0900 Subject: [PATCH] [bigdecimal] Fix deprecation warning test --- test/bigdecimal/test_bigdecimal.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index 445a3f2e46..16f5505706 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -611,9 +611,13 @@ class TestBigDecimal < Test::Unit::TestCase 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