diff options
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r-- | test/ruby/test_exception.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index a89aed8806..120b041830 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -960,13 +960,25 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| assert_equal(["\n"], capture_warning_warn {warn ""}) end - def test_warn_backwards_compatibility + def test_warn_deprecated_backwards_compatibility_category + warning = capture_warning_warn { Dir.exists?("non-existent") } + + assert_match(/deprecated/, warning[0]) + end + + def test_warn_deprecated_category + warning = capture_warning_warn(category: true) { Dir.exists?("non-existent") } + + assert_equal :deprecated, warning[0][1] + end + + def test_warn_deprecated_to_remove_backwards_compatibility_category warning = capture_warning_warn { Object.new.tainted? } assert_match(/deprecated/, warning[0]) end - def test_warn_category + def test_warn_deprecated_to_remove_category warning = capture_warning_warn(category: true) { Object.new.tainted? } assert_equal :deprecated, warning[0][1] |