diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-07 10:27:19 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-07 10:27:19 +0000 |
commit | 8c492668a7b31820918fe4f9768ee56d891bd96e (patch) | |
tree | 4b2ee5490b2fe4271def3ca2a9ac0961bc439c47 /test/ruby/test_io_m17n.rb | |
parent | 2522df965526dcbcdb632b66cc899570c2609e6c (diff) | |
download | ruby-8c492668a7b31820918fe4f9768ee56d891bd96e.tar.gz |
* test/ruby/test_io_m17n.rb
(TestIO_M17N#test_default_stdout_stderr_mode): new test for
r33627-33629. see [backport #5565]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io_m17n.rb')
-rw-r--r-- | test/ruby/test_io_m17n.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index f62ded90cb..ecf34c793f 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -2097,4 +2097,24 @@ EOT assert_equal("\r\n", open("a", "rb"){|f| f.read}) } end + + def test_default_stdout_stderr_mode + with_pipe do |in_r, in_w| + with_pipe do |out_r, out_w| + pid = Process.spawn({}, EnvUtil.rubybin, in: in_r, out: out_w, err: out_w) + in_r.close + out_w.close + in_w.write <<-EOS + STDOUT.puts "abc" + STDOUT.flush + STDERR.puts "def" + STDERR.flush + EOS + in_w.close + Process.wait pid + assert_equal "abc\r\ndef\r\n", out_r.binmode.read + out_r.close + end + end + end if /mswin|mingw/ =~ RUBY_PLATFORM end |