summaryrefslogtreecommitdiff
path: root/test/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-21 01:56:04 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-21 01:56:04 +0000
commit03a6d033aff09bd333817bdb2a67c52ca5916a83 (patch)
treedbf99069fdefc24876e5f53006377d82b01f061a /test/win32ole
parent38b1f5c1ccba119b5cafb231535a4a4cff911ff7 (diff)
* test/win32ole/test_win32ole_event.rb: test_s_new_exception is
executed on standard Windows OS without ADO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/win32ole')
-rw-r--r--test/win32ole/test_win32ole_event.rb36
1 files changed, 30 insertions, 6 deletions
diff --git a/test/win32ole/test_win32ole_event.rb b/test/win32ole/test_win32ole_event.rb
index f486749..3ab7654 100644
--- a/test/win32ole/test_win32ole_event.rb
+++ b/test/win32ole/test_win32ole_event.rb
@@ -21,8 +21,38 @@ def ado_installed?
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)
@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)}