summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_pipe.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/ruby/test_pipe.rb b/test/ruby/test_pipe.rb
index a6363ef78b..03b38635c8 100644
--- a/test/ruby/test_pipe.rb
+++ b/test/ruby/test_pipe.rb
@@ -8,7 +8,13 @@ $KCODE = 'none'
class TestPipe < Test::Unit::TestCase
include TestEOF
def open_file(content)
- f = IO.popen("echo -n #{content}")
- yield f
+ r, w = IO.pipe
+ w << content
+ w.close
+ begin
+ yield r
+ ensure
+ r.close
+ end
end
end