diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-13 09:45:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-13 09:45:12 +0000 |
commit | 8653bd97de97a43b6ae929cc808f850ebe7269cb (patch) | |
tree | f183e18f9ddd856eb45844a231312afdc0f09f9a /test/ruby/test_io_m17n.rb | |
parent | daac3ed0b4dea32d22728e0eb69ed5140ca6ad14 (diff) | |
download | ruby-8653bd97de97a43b6ae929cc808f850ebe7269cb.tar.gz |
* test/ruby/test_io_m17n.rb (TestIO_M17N#test_cbuf_select),
(TestIO_M17N#test_textmode_paragraphmode): close pipes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io_m17n.rb')
-rw-r--r-- | test/ruby/test_io_m17n.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index e7a9d6b1ad..23d7e4f406 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -1776,20 +1776,20 @@ EOT 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 |