diff options
Diffstat (limited to 'test/win32ole')
-rw-r--r-- | test/win32ole/test_thread.rb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/test/win32ole/test_thread.rb b/test/win32ole/test_thread.rb index 947d85af9e..56a6357932 100644 --- a/test/win32ole/test_thread.rb +++ b/test/win32ole/test_thread.rb @@ -9,12 +9,25 @@ if defined?(WIN32OLE) # # test for Bug #2618(ruby-core:27634) # - def test_creating_win32ole_object_in_thread - t = Thread.new do - dict = WIN32OLE.new('Scripting.Dictionary') - assert(true) - end - t.join + def assert_creating_win32ole_object_in_thread(meth) + t = Thread.__send__(meth) { + WIN32OLE.new('Scripting.Dictionary') + } + assert_nothing_raised(WIN32OLERuntimeError, "[Bug #2618] Thread.#{meth}") { + t.join + } + end + + def test_creating_win32ole_object_in_thread_new + assert_creating_win32ole_object_in_thread(:new) + end + + def test_creating_win32ole_object_in_thread_start + assert_creating_win32ole_object_in_thread(:start) + end + + def test_creating_win32ole_object_in_thread_fork + assert_creating_win32ole_object_in_thread(:fork) end end end |