ruby-changes:34147
From: akr <ko1@a...>
Date: Thu, 29 May 2014 21:42:20 +0900 (JST)
Subject: [ruby-changes:34147] akr:r46228 (trunk): test/io/nonblock/test_flush.rb: Close fds.
akr 2014-05-29 21:42:14 +0900 (Thu, 29 May 2014) New Revision: 46228 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=46228&view=revision Log: test/io/nonblock/test_flush.rb: Close fds. Modified files: trunk/test/io/nonblock/test_flush.rb Index: test/io/nonblock/test_flush.rb =================================================================== --- test/io/nonblock/test_flush.rb (revision 46227) +++ test/io/nonblock/test_flush.rb (revision 46228) @@ -7,9 +7,14 @@ end https://github.com/ruby/ruby/blob/trunk/test/io/nonblock/test_flush.rb#L7 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/