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

ruby-changes:39005

From: nobu <ko1@a...>
Date: Wed, 1 Jul 2015 17:17:49 +0900 (JST)
Subject: [ruby-changes:39005] nobu:r51086 (trunk): test_object.rb: use assert_separately

nobu	2015-07-01 17:17:37 +0900 (Wed, 01 Jul 2015)

  New Revision: 51086

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

  Log:
    test_object.rb: use assert_separately
    
    * test/ruby/test_object.rb (test_redef_method_missing): use
      assert_separately to catch segfaults and show the diagnostic
      reports.

  Modified files:
    trunk/test/ruby/test_object.rb
Index: test/ruby/test_object.rb
===================================================================
--- test/ruby/test_object.rb	(revision 51085)
+++ test/ruby/test_object.rb	(revision 51086)
@@ -807,18 +807,16 @@ class TestObject < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_object.rb#L807
   def test_redef_method_missing
     bug5473 = '[ruby-core:40287]'
     ['ArgumentError.new("bug5473")', 'ArgumentError, "bug5473"', '"bug5473"'].each do |code|
-      out, err, status = EnvUtil.invoke_ruby([], <<-SRC, true, true)
+      exc = code[/\A[A-Z]\w+/] || 'RuntimeError'
+      assert_separately([], <<-SRC)
       class ::Object
         def method_missing(m, *a, &b)
           raise #{code}
         end
       end
 
-      p((1.foo rescue $!))
+      assert_raise_with_message(#{exc}, "bug5473") {1.foo}
       SRC
-      assert_send([status, :success?], bug5473)
-      assert_equal("", err, bug5473)
-      assert_equal((eval("raise #{code}") rescue $!.inspect), out.chomp, bug5473)
     end
   end
 

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

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