mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Call deprecated method only inside assert_warning block
This commit is contained in:
parent
9cb58f1698
commit
51b2b605e7
1 changed files with 3 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue