From 9940a8d18180a79c28496214ea8c7f71f8fa7fe1 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 18 Dec 2017 04:12:06 +0000 Subject: [PATCH] test/ruby/test_io.rb: test for r61314 From: Nobuyoshi Nakada git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 009afc3297..00369365d0 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2357,6 +2357,10 @@ End IO.foreach("|" + EnvUtil.rubybin + " -e 'puts :foo; puts :bar; puts :baz'") {|x| a << x } assert_equal(["foo\n", "bar\n", "baz\n"], a) + a = [] + IO.foreach("|" + EnvUtil.rubybin + " -e 'puts :zot'", :open_args => ["r"]) {|x| a << x } + assert_equal(["zot\n"], a) + make_tempfile {|t| a = [] IO.foreach(t.path) {|x| a << x }