summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-io/test/io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-io/test/io.rb')
-rw-r--r--mrbgems/mruby-io/test/io.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/mrbgems/mruby-io/test/io.rb b/mrbgems/mruby-io/test/io.rb
index 3aaa109a8..e3024cf9a 100644
--- a/mrbgems/mruby-io/test/io.rb
+++ b/mrbgems/mruby-io/test/io.rb
@@ -129,10 +129,11 @@ end
assert "IO#read(n) with n > IO::BUF_SIZE" do
skip "pipe is not supported on this platform" if MRubyIOTestUtil.win?
- r,w = IO.pipe
- n = IO::BUF_SIZE+1
- w.write 'a'*n
- assert_equal r.read(n), 'a'*n
+ IO.pipe do |r,w|
+ n = IO::BUF_SIZE+1
+ w.write 'a'*n
+ assert_equal 'a'*n, r.read(n)
+ end
end
assert('IO#readchar', '15.2.20.5.15') do