about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-10-20 10:39:20 +0000
committerEric Wong <e@80x24.org>2013-10-21 04:09:06 +0000
commit3fbf2f7c4bdaebeaa6579b97a0b7e087a08d347f (patch)
treeb30377b2f006bb3b0b5ff8331e50604351c45b3c /test
parent50d3998e49e7f2cda4daf1d112bb1f852b4589e0 (diff)
downloadyahns-3fbf2f7c4bdaebeaa6579b97a0b7e087a08d347f.tar.gz
IO.copy_stream on rbx attempts to seek on the pipe
and raises Errno::ESPIPE as a result.

TODO: report this bug
(ugh, commercial JS/gfx/CSS-infested website w/ login)
Diffstat (limited to 'test')
-rw-r--r--test/test_output_buffering.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/test_output_buffering.rb b/test/test_output_buffering.rb
index c4d4873..2f52870 100644
--- a/test/test_output_buffering.rb
+++ b/test/test_output_buffering.rb
@@ -83,7 +83,16 @@ class TestOutputBuffering < Testcase
       md5pid = Process.spawn("md5sum", :in => md5in[0], :out => md5out[1])
       md5in[0].close
       md5out[1].close
-      assert_equal(NR * RAND.size, IO.copy_stream(c, md5in[1]))
+      begin
+        nr = IO.copy_stream(c, md5in[1])
+      rescue Errno::ESPIPE # rbx bug workaround
+        nr = 0
+        buf = ""
+        while c.read(1024 * 1024, buf)
+          nr += md5in[1].write(buf)
+        end
+      end
+      assert_equal(NR * RAND.size, nr)
       c.shutdown
       c.close
       md5in[1].close