diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-05 04:18:37 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-05 04:18:37 +0000 |
commit | 491b450f93961e2ff4c993ed7d287417d6f1869e (patch) | |
tree | e338528f42ff0351ca7ea923592f5d39b5843e1e /test/ruby/test_pipe.rb | |
parent | 47dfa853ef377e54a21eeabfdd238fa60338bf41 (diff) | |
download | ruby-491b450f93961e2ff4c993ed7d287417d6f1869e.tar.gz |
* 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
Diffstat (limited to 'test/ruby/test_pipe.rb')
-rw-r--r-- | test/ruby/test_pipe.rb | 10 |
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 |