diff options
Diffstat (limited to 'test/io')
-rw-r--r-- | test/io/nonblock/test_flush.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/io/nonblock/test_flush.rb b/test/io/nonblock/test_flush.rb index bc60cab8bf..e014a5f3db 100644 --- a/test/io/nonblock/test_flush.rb +++ b/test/io/nonblock/test_flush.rb @@ -50,4 +50,22 @@ class TestIONonblock < Test::Unit::TestCase assert_equal(4097, result.size) true end + + def test_nonblock + IO.pipe {|r, w| + assert_equal(false, w.nonblock?) + w.nonblock do + assert_equal(true, w.nonblock?) + w.nonblock(false) do + assert_equal(false, w.nonblock?) + w.nonblock(false) do + assert_equal(false, w.nonblock?) + end + assert_equal(false, w.nonblock?) + end + assert_equal(true, w.nonblock?) + end + assert_equal(false, w.nonblock?) + } + end end if IO.method_defined?(:nonblock) |