summaryrefslogtreecommitdiff
path: root/test/rinda/test_rinda.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rinda/test_rinda.rb')
-rw-r--r--test/rinda/test_rinda.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index b69b63ac78..e91ecf395f 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -539,9 +539,13 @@ class TupleSpaceProxyTest < Test::Unit::TestCase
end
def test_remote_array_and_hash
- @ts.write(DRbObject.new([1, 2, 3]))
+ # Don't remove ary/hsh local variables.
+ # These are necessary to protect objects from GC.
+ ary = [1, 2, 3]
+ @ts.write(DRbObject.new(ary))
assert_equal([1, 2, 3], @ts.take([1, 2, 3], 0))
- @ts.write(DRbObject.new({'head' => 1, 'tail' => 2}))
+ hsh = {'head' => 1, 'tail' => 2}
+ @ts.write(DRbObject.new(hsh))
assert_equal({'head' => 1, 'tail' => 2},
@ts.take({'head' => 1, 'tail' => 2}, 0))
end