about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/dtas/pipe.rb3
-rw-r--r--test/test_buffer.rb4
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/dtas/pipe.rb b/lib/dtas/pipe.rb
index cd3ac46..41783d3 100644
--- a/lib/dtas/pipe.rb
+++ b/lib/dtas/pipe.rb
@@ -21,9 +21,6 @@ class DTAS::Pipe < IO # :nodoc:
   unless method_defined?(:pipe_size=)
     def pipe_size=(_)
     end
-
-    def pipe_size
-    end
   end
 end
 
diff --git a/test/test_buffer.rb b/test/test_buffer.rb
index 677ca62..d74cdce 100644
--- a/test/test_buffer.rb
+++ b/test/test_buffer.rb
@@ -118,6 +118,8 @@ class TestBuffer < Testcase
     assert_equal :wait_readable, buf.broadcast([a[1], b[1]])
     assert_equal 5, buf.bytes_xfer
 
+    return unless b[1].respond_to?(:pipe_size)
+
     b[1].nonblock = true
     b[1].write('*' * b[1].pipe_size)
     buf.wr.write "BYE"
@@ -175,7 +177,7 @@ class TestBuffer < Testcase
     buf.wr.write "HELLO"
     assert_equal tmp, buf.broadcast(tmp)
     assert_equal [a[1], b[1]], tmp
-  end
+  end if IO.method_defined?(:pipe_size)
 
   def test_serialize
     buf = new_buffer