summaryrefslogtreecommitdiff
path: root/test/io/nonblock/test_flush.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/io/nonblock/test_flush.rb')
-rw-r--r--test/io/nonblock/test_flush.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/io/nonblock/test_flush.rb b/test/io/nonblock/test_flush.rb
index 5ca4beba60..dbe20722cf 100644
--- a/test/io/nonblock/test_flush.rb
+++ b/test/io/nonblock/test_flush.rb
@@ -13,10 +13,14 @@ class TestIONonblock < Test::Unit::TestCase
Thread.pass
w.close
}
- Thread.new {
- Thread.pass
- nil while r.read(4096)
+ result = ""
+ t = Thread.new {
+ while (Thread.pass; s = r.read(4096))
+ result << s
+ end
}
assert_raise(IOError) {w.flush}
+ t.join
+ assert_equal("b", result)
end
end