diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-06-15 02:39:13 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-06-15 02:39:13 +0000 |
commit | 9159f70862e3e6a76d821c4a70bc68a603793a49 (patch) | |
tree | f3ef5c6c5dfc73f54ebd7e71d4f56e29d16396a6 /test | |
parent | 6d6f704e29d7bf1e95f1c9c60cbab82ec3d430d2 (diff) | |
download | kgio-9159f70862e3e6a76d821c4a70bc68a603793a49.tar.gz |
Kgio::File may be used to open FIFOs, so non-blocking I/O is still useful in that context.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_tryopen.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_tryopen.rb b/test/test_tryopen.rb index e60cb27..380026d 100644 --- a/test/test_tryopen.rb +++ b/test/test_tryopen.rb @@ -36,6 +36,14 @@ class TestTryopen < Test::Unit::TestCase assert_equal "FOO", tmp.sysread(3) end + def test_tryopen_try_readwrite + tmp = Tempfile.new "tryopen" + file = Kgio::File.tryopen(tmp.path, IO::RDWR) + assert_nil file.kgio_trywrite("FOO") + file.rewind + assert_equal "FOO", file.kgio_tryread(3) + end + def test_tryopen_mode tmp = Tempfile.new "tryopen" path = tmp.path |