summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-17 16:27:02 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-17 16:27:02 +0000
commit6dda216da1356099bb9021592d29c4fa7d16f84b (patch)
tree7181975efa3ea7a844acf9cc4fa2e36afeab5543 /test/ruby
parent457c2c4a55b5896b30510ff8b39256b61b46cdf4 (diff)
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_io.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 0052a9263c..6d7f94eaab 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1312,6 +1312,19 @@ class TestIO < Test::Unit::TestCase
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 }