diff options
author | Eric Wong <e@80x24.org> | 2013-10-20 10:39:20 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2013-10-21 04:09:06 +0000 |
commit | 3fbf2f7c4bdaebeaa6579b97a0b7e087a08d347f (patch) | |
tree | b30377b2f006bb3b0b5ff8331e50604351c45b3c /test | |
parent | 50d3998e49e7f2cda4daf1d112bb1f852b4589e0 (diff) | |
download | yahns-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.rb | 11 |
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 |