ruby-changes:36828
From: suke <ko1@a...>
Date: Sun, 21 Dec 2014 10:56:13 +0900 (JST)
Subject: [ruby-changes:36828] suke:r48909 (trunk): * test/win32ole/test_win32ole_event.rb: test_s_new_exception is
suke 2014-12-21 10:56:04 +0900 (Sun, 21 Dec 2014) New Revision: 48909 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48909 Log: * test/win32ole/test_win32ole_event.rb: test_s_new_exception is executed on standard Windows OS without ADO. Modified files: trunk/ChangeLog trunk/test/win32ole/test_win32ole_event.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 48908) +++ ChangeLog (revision 48909) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Dec 21 10:51:51 2014 Masaki Suketa <masaki.suketa@n...> + + * test/win32ole/test_win32ole_event.rb: test_s_new_exception is + executed on standard Windows OS without ADO. + Sun Dec 21 08:35:26 2014 Nobuyoshi Nakada <nobu@r...> * configure.in (jemalloc): fix option argument, should use Index: test/win32ole/test_win32ole_event.rb =================================================================== --- test/win32ole/test_win32ole_event.rb (revision 48908) +++ test/win32ole/test_win32ole_event.rb (revision 48909) @@ -21,8 +21,38 @@ def ado_installed? https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L21 installed end +def swbemsink_avairable? + available = false + if defined?(WIN32OLE) + wmi = nil + begin + wmi = WIN32OLE.new('WbemScripting.SWbemSink') + available = true + rescue + end + end + available +end + if defined?(WIN32OLE_EVENT) class TestWIN32OLE_EVENT < Test::Unit::TestCase + def test_s_new_exception + assert_raise(TypeError) { + WIN32OLE_EVENT.new("A") + } + end + end + + class TestWIN32OLE_EVENT_SWbemSink < Test::Unit::TestCase + unless swbemsink_avairable? + def test_dummy_for_skip_message + skip "'WbemScripting.SWbemSink' is not available" + end + else + end + end + + class TestWIN32OLE_EVENT_ADO < Test::Unit::TestCase unless ado_installed? def test_dummy_for_skip_message skip "ActiveX Data Object Library not found" @@ -50,12 +80,6 @@ if defined?(WIN32OLE_EVENT) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L80 @event3 = "" end - def test_s_new - assert_raise(TypeError) { - WIN32OLE_EVENT.new("A") - } - end - def test_s_new_without_itf ev = WIN32OLE_EVENT.new(@db) ev.on_event {|*args| default_handler(*args)} -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/