From cef5f426a79f3c1a12fe929bc99c219c3509a77d Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 5 Dec 2003 04:18:37 +0000 Subject: * test/ruby/test_pipe.rb: use IO.pipe instead of IO.popen. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_pipe.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/ruby/test_pipe.rb') diff --git a/test/ruby/test_pipe.rb b/test/ruby/test_pipe.rb index a6363ef78..03b38635c 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 -- cgit