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 }