summaryrefslogtreecommitdiff
path: root/test/thread
diff options
context:
space:
mode:
Diffstat (limited to 'test/thread')
-rw-r--r--test/thread/test_cv.rb7
-rw-r--r--test/thread/test_queue.rb7
2 files changed, 14 insertions, 0 deletions
diff --git a/test/thread/test_cv.rb b/test/thread/test_cv.rb
index bb0bcb86853..9f9e08e2ec3 100644
--- a/test/thread/test_cv.rb
+++ b/test/thread/test_cv.rb
@@ -197,11 +197,18 @@ INPUT
end
end
+ (DumpableCV = ConditionVariable.dup).class_eval {remove_method :marshal_dump}
+
def test_dump
bug9674 = '[ruby-core:61677] [Bug #9674]'
condvar = ConditionVariable.new
assert_raise_with_message(TypeError, /#{ConditionVariable}/, bug9674) do
Marshal.dump(condvar)
end
+
+ condvar = DumpableCV.new
+ assert_raise_with_message(TypeError, /internal Array/, bug9674) do
+ Marshal.dump(condvar)
+ end
end
end
diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb
index b3662742c12..cda76ce61cd 100644
--- a/test/thread/test_queue.rb
+++ b/test/thread/test_queue.rb
@@ -216,6 +216,8 @@ class TestQueue < Test::Unit::TestCase
end
end
+ (DumpableQueue = Queue.dup).class_eval {remove_method :marshal_dump}
+
def test_dump
bug9674 = '[ruby-core:61677] [Bug #9674]'
q = Queue.new
@@ -227,5 +229,10 @@ class TestQueue < Test::Unit::TestCase
assert_raise_with_message(TypeError, /#{SizedQueue}/, bug9674) do
Marshal.dump(sq)
end
+
+ q = DumpableQueue.new
+ assert_raise_with_message(TypeError, /internal Array/, bug9674) do
+ Marshal.dump(q)
+ end
end
end