summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/rinda/test_rinda.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index d2b2c7f17e..7ac6918819 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -6,6 +6,8 @@ require 'rinda/tuplespace'
require 'singleton'
+require 'weakref'
+
module Rinda
class MockClock
@@ -499,6 +501,14 @@ class TupleSpaceTest < Test::Unit::TestCase
ThreadGroup.new.add(Thread.current)
@ts = Rinda::TupleSpace.new(1)
end
+
+ def test_gc
+ w = WeakRef.new(Rinda::TupleSpace.new)
+ GC.start
+ assert_raises(WeakRef::RefError) do
+ w.__getobj__
+ end
+ end
end
class TupleSpaceProxyTest < Test::Unit::TestCase