From d998717eee85940a15ef378d43a42b3bea26e0f2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 8 Sep 2013 12:24:48 +0000 Subject: pipe: remove pipe_size call for non-Linux platforms Having it return nil in a noop function seems wrong. We can't silently discard the value (unlike pipe_size=) --- lib/dtas/pipe.rb | 3 --- test/test_buffer.rb | 4 +++- 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 -- cgit v1.2.3-24-ge0c7