diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-07-16 15:19:47 +1200 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-07-20 13:20:58 +1200 |
commit | e6e9cef06e9023a80991518297d9f2c0c12488ce (patch) | |
tree | a9226cb928c7d2600dcbbb1bbdecbbce0eb277f9 /test/fiber/test_io.rb | |
parent | a3ac1bf450d2aa0c6b0b34fee417992b4352ff2c (diff) | |
download | ruby-e6e9cef06e9023a80991518297d9f2c0c12488ce.tar.gz |
Improve consistency of tests.
Diffstat (limited to 'test/fiber/test_io.rb')
-rw-r--r-- | test/fiber/test_io.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/fiber/test_io.rb b/test/fiber/test_io.rb index e7f06f7429..bf200061d8 100644 --- a/test/fiber/test_io.rb +++ b/test/fiber/test_io.rb @@ -6,10 +6,15 @@ class TestFiberIO < Test::Unit::TestCase MESSAGE = "Hello World" def test_read - skip unless defined?(UNIXSocket) + skip "UNIXSocket is not defined!" unless defined?(UNIXSocket) i, o = UNIXSocket.pair - skip unless i.nonblock? && o.nonblock? + + unless i.nonblock? && o.nonblock? + i.close + o.close + skip "I/O is not non-blocking!" + end message = nil @@ -31,5 +36,7 @@ class TestFiberIO < Test::Unit::TestCase thread.join assert_equal MESSAGE, message + assert_predicate(i, :closed?) + assert_predicate(o, :closed?) end end |