summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-29 12:42:14 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-29 12:42:14 +0000
commita2f9b00ad4871d3b0992212b89a2ecbe662e17b5 (patch)
treee61980e3867050280c357e4d830a28e6a140d118
parenta1afdfeb06c01a0d16fce52e63ef8383c43754e3 (diff)
test/io/nonblock/test_flush.rb: Close fds.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/io/nonblock/test_flush.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/io/nonblock/test_flush.rb b/test/io/nonblock/test_flush.rb
index b031c71bf8..8c93c814a3 100644
--- a/test/io/nonblock/test_flush.rb
+++ b/test/io/nonblock/test_flush.rb
@@ -7,9 +7,14 @@ end
class TestIONonblock < Test::Unit::TestCase
def test_flush
- flush_test(*IO.pipe) or
- (require 'socket'; flush_test(*Socket.pair(:INET, :STREAM))) or
- skip "nonblocking IO did not work"
+ IO.pipe {|r, w|
+ return if flush_test(r, w)
+ }
+ require 'socket';
+ Socket.pair(:INET, :STREAM) {|s1, s2|
+ return if flush_test(s1, s2)
+ }
+ skip "nonblocking IO did not work"
end
def flush_test(r, w)