ruby-changes:23599
From: nobu <ko1@a...>
Date: Tue, 15 May 2012 23:55:00 +0900 (JST)
Subject: [ruby-changes:23599] nobu:r35649 (trunk): test/ruby/test_marshal.rb: close pipes
nobu 2012-05-15 23:54:09 +0900 (Tue, 15 May 2012) New Revision: 35649 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35649 Log: test/ruby/test_marshal.rb: close pipes * test/ruby/test_marshal.rb (TestMarshal#test_pipe): should close pipes. Modified files: trunk/test/ruby/test_marshal.rb Index: test/ruby/test_marshal.rb =================================================================== --- test/ruby/test_marshal.rb (revision 35648) +++ test/ruby/test_marshal.rb (revision 35649) @@ -103,16 +103,16 @@ 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) } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/