summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_exception.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index da1cbd37cf..ce3e98f2c8 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -1003,6 +1003,11 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
assert_equal(["\n"], capture_warning_warn {warn ""})
end
+ def test_kernel_warn_uplevel
+ warning = capture_warning_warn {warn("test warning", uplevel: 0)}
+ assert_equal("#{__FILE__}:#{__LINE__-1}: warning: test warning\n", warning[0])
+ end
+
def test_warning_warn_invalid_argument
assert_raise(TypeError) do
::Warning.warn nil