mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
457c2c4a55
commit
6dda216da1
1 changed files with 13 additions and 0 deletions
|
@ -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 }
|
||||
|
|
Loading…
Add table
Reference in a new issue