[前][次][番号順一覧][スレッド一覧]

ruby-changes:27875

From: nobu <ko1@a...>
Date: Mon, 25 Mar 2013 18:05:41 +0900 (JST)
Subject: [ruby-changes:27875] nobu:r39927 (trunk): test_method.rb: refine assertions

nobu	2013-03-25 18:03:54 +0900 (Mon, 25 Mar 2013)

  New Revision: 39927

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39927

  Log:
    test_method.rb: refine assertions
    
    * test/ruby/test_method.rb (test_unlinked_method_entry_in_method_object_bug):
      use assert_normal_exit since subject code never exit successfully,
      but check if timed out paranoically.

  Modified files:
    trunk/test/ruby/test_method.rb

Index: test/ruby/test_method.rb
===================================================================
--- test/ruby/test_method.rb	(revision 39926)
+++ test/ruby/test_method.rb	(revision 39927)
@@ -579,14 +579,18 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_method.rb#L579
 
   def test_unlinked_method_entry_in_method_object_bug
     bug8100 = '[ruby-core:53640] [Bug #8100]'
-    assert_ruby_status [], %q{
+    begin
+      assert_normal_exit %q{
       loop do
         def x
           "hello" * 1000
         end
         method(:x).call
       end
-    }, bug8100, timeout: 2
-  rescue Timeout::Error
+      }, bug8100, timeout: 2
+    rescue Timeout::Error => e
+    else
+    end
+    assert_raise(Timeout::Error, bug8100) {raise e if e}
   end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]