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

ruby-changes:14837

From: akr <ko1@a...>
Date: Thu, 18 Feb 2010 01:27:13 +0900 (JST)
Subject: [ruby-changes:14837] Ruby:r26702 (trunk): add a test.

akr	2010-02-18 01:27:02 +0900 (Thu, 18 Feb 2010)

  New Revision: 26702

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

  Log:
    add a test.

  Modified files:
    trunk/test/ruby/test_io.rb

Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 26701)
+++ test/ruby/test_io.rb	(revision 26702)
@@ -1312,6 +1312,19 @@
     end
   end
 
+  def test_reopen_inherit
+    mkcdtmpdir {
+      system(EnvUtil.rubybin, '-e', <<"End")
+        f = open("out", "w")
+        STDOUT.reopen(f)
+        STDERR.reopen(f)
+        system(#{EnvUtil.rubybin.dump}, '-e', 'STDOUT.print "out"')
+        system(#{EnvUtil.rubybin.dump}, '-e', 'STDERR.print "err"')
+End
+      assert_equal("outerr", File.read("out"))
+    }
+  end
+
   def test_foreach
     a = []
     IO.foreach("|" + EnvUtil.rubybin + " -e 'puts :foo; puts :bar; puts :baz'") {|x| a << x }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

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