ruby-changes:46369
From: naruse <ko1@a...>
Date: Wed, 26 Apr 2017 04:13:43 +0900 (JST)
Subject: [ruby-changes:46369] naruse:r58483 (trunk): suppress_warning
naruse 2017-04-26 04:13:26 +0900 (Wed, 26 Apr 2017) New Revision: 58483 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58483 Log: suppress_warning Modified files: trunk/test/coverage/test_coverage.rb Index: test/coverage/test_coverage.rb =================================================================== --- test/coverage/test_coverage.rb (revision 58482) +++ test/coverage/test_coverage.rb (revision 58483) @@ -2,6 +2,7 @@ https://github.com/ruby/ruby/blob/trunk/test/coverage/test_coverage.rb#L2 require "test/unit" require "coverage" require "tmpdir" +require "envutil" class TestCoverage < Test::Unit::TestCase def test_result_without_start @@ -114,8 +115,10 @@ class TestCoverage < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/coverage/test_coverage.rb#L115 def test_nonpositive_linenumber bug12517 = '[ruby-core:76141] [Bug #12517]' Coverage.start - assert_nothing_raised(ArgumentError, bug12517) do - RubyVM::InstructionSequence.compile(":ok", nil, "<compiled>", 0) + EnvUtil.suppress_warning do + assert_nothing_raised(ArgumentError, bug12517) do + RubyVM::InstructionSequence.compile(":ok", nil, "<compiled>", 0) + end end assert_include Coverage.result, "<compiled>" end @@ -142,7 +145,9 @@ class TestCoverage < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/coverage/test_coverage.rb#L145 Coverage.start require tmp + '/test.rb' - add_method(Class.new) + EnvUtil.suppress_warning do + add_method(Class.new) + end assert_equal Coverage.result[tmp + "/test.rb"], [1, 1, 1, 400, nil, nil, nil, nil, nil, nil, nil], bug13305 } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/