summaryrefslogtreecommitdiff
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb4
1 files changed, 4 insertions, 0 deletions
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 }