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

ruby-changes:29366

From: nobu <ko1@a...>
Date: Wed, 19 Jun 2013 16:47:42 +0900 (JST)
Subject: [ruby-changes:29366] nobu:r41417 (trunk): test_io.rb: use assert_separately

nobu	2013-06-19 16:47:17 +0900 (Wed, 19 Jun 2013)

  New Revision: 41417

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

  Log:
    test_io.rb: use assert_separately
    
    * test/ruby/test_io.rb (test_cross_thread_close_stdio): use
      assert_separately instead of separated fork and assert.

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

Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 41416)
+++ test/ruby/test_io.rb	(revision 41417)
@@ -2261,25 +2261,18 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2261
   end
 
   def test_cross_thread_close_stdio
-    with_pipe do |r,w|
-      pid = fork do
+    assert_separately([], <<-'end;')
+      IO.pipe do |r,w|
         $stdin.reopen(r)
         r.close
         read_thread = Thread.new do
-          begin
-            $stdin.read(1)
-          rescue => e
-            e
-          end
+          $stdin.read(1)
         end
         sleep(0.1) until read_thread.stop?
         $stdin.close
-        read_thread.join
-        exit(IOError === read_thread.value)
+        assert_raise(IOError) {read_thread.join}
       end
-      assert Process.waitpid2(pid)[1].success?
-    end
-    rescue NotImplementedError
+    end;
   end
 
   def test_open_mode

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

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