about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-05-10 12:36:59 -0700
committerEric Wong <normalperson@yhbt.net>2011-05-10 12:36:59 -0700
commitb8b2d02b56e29466a0437b4bb8e8e0608a933f89 (patch)
tree63031726eff12ce04e1c1570a04ef7a2c8b00c27
parent5e73ae9c477d0ba64f497f0517be20e65ba0c253 (diff)
downloadruby_io_splice-b8b2d02b56e29466a0437b4bb8e8e0608a933f89.tar.gz
timeout doesn't seem to interrupt C extensions reliably
in some cases...
-rw-r--r--test/test_io_splice.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test_io_splice.rb b/test/test_io_splice.rb
index 6943bf9..26f2e00 100644
--- a/test/test_io_splice.rb
+++ b/test/test_io_splice.rb
@@ -9,6 +9,10 @@ require 'io/splice'
 
 class Test_IO_Splice < Test::Unit::TestCase
 
+  def self.mri?
+    (defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby") || !defined?(RUBY_ENGINE)
+  end
+
   def test_splice
     str = 'abcde'
     size = 5
@@ -415,7 +419,7 @@ class Test_IO_Splice < Test::Unit::TestCase
     assert_equal 0, nr
     rs.close
     server.close
-  end
+  end if mri?
 
   def test_copy_stream_nonblock_dst
     server = TCPServer.new('127.0.0.1', 0)
@@ -440,7 +444,7 @@ class Test_IO_Splice < Test::Unit::TestCase
     assert_equal nr, client.read(nr).size
     rs.close
     server.close
-  end
+  end if mri?
 
   def test_copy_stream_eof
     r, w = IO.pipe
@@ -466,5 +470,4 @@ class Test_IO_Splice < Test::Unit::TestCase
     assert_nothing_raised { r.pipe_size = pipe_max_size }
     assert_raises(Errno::EPERM) { r.pipe_size = pipe_max_size * 2 }
   end if IO.method_defined?(:pipe_size)
-
 end