summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-15 14:54:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-15 14:54:09 +0000
commit498a001fa7a1d6a8a040b1725cd8551ad317c462 (patch)
treea1de1dbf6be23c8bc680492994764e9763c2124f /test/ruby/test_marshal.rb
parent068253783e1dde29d5e03bb9566b22abcb1ed24b (diff)
test/ruby/test_marshal.rb: close pipes
* test/ruby/test_marshal.rb (TestMarshal#test_pipe): should close pipes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r--test/ruby/test_marshal.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 1dea7e14dd..85cec0adca 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -103,16 +103,16 @@ class TestMarshal < Test::Unit::TestCase
def test_pipe
o1 = C.new("a" * 10000)
- r, w = IO.pipe
- t = Thread.new { Marshal.load(r) }
- Marshal.dump(o1, w)
- o2 = t.value
+ o2 = IO.pipe do |r, w|
+ Thread.new {Marshal.dump(o1, w)}
+ Marshal.load(r)
+ end
assert_equal(o1.str, o2.str)
- r, w = IO.pipe
- t = Thread.new { Marshal.load(r) }
- Marshal.dump(o1, w, 2)
- o2 = t.value
+ o2 = IO.pipe do |r, w|
+ Thread.new {Marshal.dump(o1, w, 2)}
+ Marshal.load(r)
+ end
assert_equal(o1.str, o2.str)
assert_raise(TypeError) { Marshal.dump("foo", Object.new) }