[前][次][番号順一覧][スレッド一覧]

ruby-changes:15898

From: yugui <ko1@a...>
Date: Sun, 16 May 2010 21:17:27 +0900 (JST)
Subject: [ruby-changes:15898] Ruby:r27838 (ruby_1_9_2): merges r27784 from trunk into ruby_1_9_2.

yugui	2010-05-16 21:15:46 +0900 (Sun, 16 May 2010)

  New Revision: 27838

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27838

  Log:
    merges r27784 from trunk into ruby_1_9_2.
    --
    * test/ruby/test_io_m17n.rb (TestIO_M17N#test_cbuf_select),
      (TestIO_M17N#test_textmode_paragraphmode): close pipes.

  Modified files:
    branches/ruby_1_9_2/test/ruby/test_io_m17n.rb

Index: ruby_1_9_2/test/ruby/test_io_m17n.rb
===================================================================
--- ruby_1_9_2/test/ruby/test_io_m17n.rb	(revision 27837)
+++ ruby_1_9_2/test/ruby/test_io_m17n.rb	(revision 27838)
@@ -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/

[前][次][番号順一覧][スレッド一覧]