ruby-changes:27989
From: nobu <ko1@a...>
Date: Tue, 2 Apr 2013 00:00:46 +0900 (JST)
Subject: [ruby-changes:27989] nobu:r40041 (trunk): test_optparse.rb: skip no_error in backtrace
nobu 2013-04-02 00:00:36 +0900 (Tue, 02 Apr 2013) New Revision: 40041 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40041 Log: test_optparse.rb: skip no_error in backtrace * test/optparse/test_optparse.rb (TestOptionParser#assert_no_error): prefix with assert_ so it will be skipped in backtrace. Modified files: trunk/test/optparse/test_optparse.rb Index: test/optparse/test_optparse.rb =================================================================== --- test/optparse/test_optparse.rb (revision 40040) +++ test/optparse/test_optparse.rb (revision 40041) @@ -10,7 +10,7 @@ class TestOptionParser < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/optparse/test_optparse.rb#L10 class DummyOutput < String alias write << end - def no_error(*args) + def assert_no_error(*args) $stderr, stderr = DummyOutput.new, $stderr assert_nothing_raised(*args) {return yield} ensure @@ -18,6 +18,7 @@ class TestOptionParser < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/optparse/test_optparse.rb#L18 $!.backtrace.delete_if {|e| /\A#{Regexp.quote(__FILE__)}:#{__LINE__-2}/o =~ e} if $! assert_empty(stderr) end + alias no_error assert_no_error def test_permute assert_equal(%w"", no_error {@opt.permute!(%w"")}) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/