mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_exception.rb: more assertions
[ruby-core:84568] [Bug #14262] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fa2e4a2061
commit
487efc80b0
1 changed files with 5 additions and 0 deletions
|
@ -1007,6 +1007,11 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
|
|||
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])
|
||||
def (obj = Object.new).w(n) warn("test warning", uplevel: n) end
|
||||
warning = capture_warning_warn {obj.w(0)}
|
||||
assert_equal("#{__FILE__}:#{__LINE__-2}: warning: test warning\n", warning[0])
|
||||
warning = capture_warning_warn {obj.w(1)}
|
||||
assert_equal("#{__FILE__}:#{__LINE__-1}: warning: test warning\n", warning[0])
|
||||
assert_raise(ArgumentError) {warn("test warning", uplevel: -1)}
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue