diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-09-08 12:24:48 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-09-08 12:32:58 +0000 |
commit | d998717eee85940a15ef378d43a42b3bea26e0f2 (patch) | |
tree | a9a296220bcdd664f3088b925981dfc7ee480e87 | |
parent | 25c0c64867108322f42f558177d659dd14333ad4 (diff) | |
download | dtas-d998717eee85940a15ef378d43a42b3bea26e0f2.tar.gz |
Having it return nil in a noop function seems wrong. We can't silently discard the value (unlike pipe_size=)
-rw-r--r-- | lib/dtas/pipe.rb | 3 | ||||
-rw-r--r-- | 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 |