From 6dda216da1356099bb9021592d29c4fa7d16f84b Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 17 Feb 2010 16:27:02 +0000 Subject: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby/test_io.rb') 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 } -- cgit v1.2.3