Skip to content

Commit

Permalink
Test deprecation warning with $;
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Mar 15, 2024
1 parent c0b8dee commit 03e7b26
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions test/ruby/test_exception.rb
Expand Up @@ -1111,19 +1111,13 @@ def test_warning_warn
end

def test_warn_deprecated_backwards_compatibility_category
omit "no method to test"

warning = capture_warning_warn { }

assert_match(/deprecated/, warning[0])
end

def test_warn_deprecated_category
omit "no method to test"

warning = capture_warning_warn(category: true) { }
(message, category), = capture_warning_warn(category: true) do
$; = "www"
$; = nil
end

assert_equal :deprecated, warning[0][1]
assert_include message, 'deprecated'
assert_equal :deprecated, category
end

def test_kernel_warn_uplevel
Expand Down

0 comments on commit 03e7b26

Please sign in to comment.