diff options
author | Nobuyoshi Nakada <[email protected]> | 2019-06-30 22:49:10 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2019-07-01 00:22:39 +0900 |
commit | 51b2b605e78a160790c6d751b2907b836b39561c (patch) | |
tree | eb6fcb66c2d0d0e4cef763157461190ef9311463 /test | |
parent | 9cb58f1698b4a11af24d1129eb6b85d27e0a7145 (diff) |
Call deprecated method only inside assert_warning block
Diffstat (limited to 'test')
-rw-r--r-- | test/test_cmath.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/test_cmath.rb b/test/test_cmath.rb index b3692bc7cf..c603cd2bbe 100644 --- a/test/test_cmath.rb +++ b/test/test_cmath.rb @@ -4,13 +4,11 @@ require 'cmath' class TestCMath < Test::Unit::TestCase def test_deprecated_method - orig = $VERBOSE - $VERBOSE = true + root = nil assert_warning(/CMath#sqrt! is deprecated; use CMath#sqrt or Math#sqrt/) do - CMath.sqrt!(1) + root = CMath.sqrt!(1) end - assert_equal CMath.sqrt(1), CMath.sqrt!(1) - $VERBOSE = orig + assert_equal CMath.sqrt(1), root end def test_sqrt |