Test deprecation warning with $;

This commit is contained in:
Nobuyoshi Nakada 2024-03-15 18:31:59 +09:00
parent c0b8dee95a
commit 03e7b266a7

View File

@ -1111,19 +1111,13 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
end
def test_warn_deprecated_backwards_compatibility_category
omit "no method to test"
(message, category), = capture_warning_warn(category: true) do
$; = "www"
$; = nil
end
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) { }
assert_equal :deprecated, warning[0][1]
assert_include message, 'deprecated'
assert_equal :deprecated, category
end
def test_kernel_warn_uplevel