about summary refs log tree commit homepage
path: root/test/test_io_splice.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_io_splice.rb')
-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