diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_pipe.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_pipe.rb b/test/ruby/test_pipe.rb index 34f231ad8c..bcea91bebb 100644 --- a/test/ruby/test_pipe.rb +++ b/test/ruby/test_pipe.rb @@ -13,4 +13,17 @@ class TestPipe < Test::Unit::TestCase r.close end end + class WithConversion < self + def open_file(content) + r, w = IO.pipe + w << content + w.close + r.set_encoding("us-ascii:utf-8") + begin + yield r + ensure + r.close + end + end + end end |
