From 491b450f93961e2ff4c993ed7d287417d6f1869e Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 5 Dec 2003 04:18:37 +0000 Subject: [PATCH] * test/ruby/test_pipe.rb: use IO.pipe instead of IO.popen. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ test/ruby/test_pipe.rb | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6bc740afe..a394967b81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Dec 5 13:17:30 2003 Tanaka Akira + + * test/ruby/test_pipe.rb: use IO.pipe instead of IO.popen. + Fri Dec 5 11:54:45 2003 Nobuyoshi Nakada * ext/stringio/stringio.c (strio_read): follow IO#read. 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