ruby-changes:49410
From: nobu <ko1@a...>
Date: Sun, 31 Dec 2017 22:12:52 +0900 (JST)
Subject: [ruby-changes:49410] nobu:r61526 (trunk): test_exception.rb: more assertions
nobu 2017-12-31 22:12:47 +0900 (Sun, 31 Dec 2017) New Revision: 61526 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61526 Log: test_exception.rb: more assertions [ruby-core:84568] [Bug #14262] Modified files: trunk/test/ruby/test_exception.rb Index: test/ruby/test_exception.rb =================================================================== --- test/ruby/test_exception.rb (revision 61525) +++ test/ruby/test_exception.rb (revision 61526) @@ -1007,6 +1007,11 @@ $stderr = $stdout; raise "\x82\xa0"') do https://github.com/ruby/ruby/blob/trunk/test/ruby/test_exception.rb#L1007 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/