ruby-changes:15850
From: nobu <ko1@a...>
Date: Thu, 13 May 2010 18:45:21 +0900 (JST)
Subject: [ruby-changes:15850] Ruby:r27784 (trunk): * test/ruby/test_io_m17n.rb (TestIO_M17N#test_cbuf_select),
nobu 2010-05-13 18:45:12 +0900 (Thu, 13 May 2010) New Revision: 27784 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27784 Log: * test/ruby/test_io_m17n.rb (TestIO_M17N#test_cbuf_select), (TestIO_M17N#test_textmode_paragraphmode): close pipes. Modified files: trunk/test/ruby/test_io_m17n.rb Index: test/ruby/test_io_m17n.rb =================================================================== --- test/ruby/test_io_m17n.rb (revision 27783) +++ test/ruby/test_io_m17n.rb (revision 27784) @@ -1776,20 +1776,20 @@ end def test_cbuf_select - r, w = IO.pipe - w << "\r\n" - r.set_encoding("US-ASCII:UTF-8", :universal_newline => true) - r.ungetc(r.getc) - assert_equal([[r],[],[]], IO.select([r], nil, nil, 1)) + with_pipe("US-ASCII:UTF-8", :universal_newline => true) do |r, w| + w << "\r\n" + r.ungetc(r.getc) + assert_equal([[r],[],[]], IO.select([r], nil, nil, 1)) + end end def test_textmode_paragraphmode - r, w = IO.pipe - w << "a\n\n\nc".gsub(/\n/, "\r\n") - w.close - r.set_encoding("US-ASCII:UTF-8", :universal_newline => true) - assert_equal("a\n\n", r.gets("")) - assert_equal("c", r.gets(""), "[ruby-core:23723] (18)") + with_pipe("US-ASCII:UTF-8", :universal_newline => true) do |r, w| + w << "a\n\n\nc".gsub(/\n/, "\r\n") + w.close + assert_equal("a\n\n", r.gets("")) + assert_equal("c", r.gets(""), "[ruby-core:23723] (18)") + end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/