зеркало из https://github.com/github/ruby.git
test_win32ole_event.rb: skip 80041008
* test/win32ole/test_win32ole_event.rb (exec_notification_query_async): skip error with OLE error code:80041008, which seems to occur when logging in as a non admistrator user. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
9507c92d37
Коммит
e7d578bf58
|
@ -91,7 +91,7 @@ if defined?(WIN32OLE_EVENT)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_s_new_loop
|
def test_s_new_loop
|
||||||
@wmi.ExecNotificationQueryAsync(@sws, @sql)
|
exec_notification_query_async
|
||||||
ev = WIN32OLE_EVENT.new(@sws)
|
ev = WIN32OLE_EVENT.new(@sws)
|
||||||
ev.on_event {|*args| default_handler(*args)}
|
ev.on_event {|*args| default_handler(*args)}
|
||||||
message_loop
|
message_loop
|
||||||
|
@ -104,7 +104,7 @@ if defined?(WIN32OLE_EVENT)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_on_event
|
def test_on_event
|
||||||
@wmi.ExecNotificationQueryAsync(@sws, @sql)
|
exec_notification_query_async
|
||||||
ev = WIN32OLE_EVENT.new(@sws, 'ISWbemSinkEvents')
|
ev = WIN32OLE_EVENT.new(@sws, 'ISWbemSinkEvents')
|
||||||
ev.on_event {|*args| default_handler(*args)}
|
ev.on_event {|*args| default_handler(*args)}
|
||||||
message_loop
|
message_loop
|
||||||
|
@ -112,7 +112,7 @@ if defined?(WIN32OLE_EVENT)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_on_event_symbol
|
def test_on_event_symbol
|
||||||
@wmi.ExecNotificationQueryAsync(@sws, @sql)
|
exec_notification_query_async
|
||||||
ev = WIN32OLE_EVENT.new(@sws)
|
ev = WIN32OLE_EVENT.new(@sws)
|
||||||
ev.on_event(:OnObjectReady) {|*args|
|
ev.on_event(:OnObjectReady) {|*args|
|
||||||
handler1
|
handler1
|
||||||
|
@ -121,6 +121,14 @@ if defined?(WIN32OLE_EVENT)
|
||||||
assert_equal("handler1", @event1)
|
assert_equal("handler1", @event1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def exec_notification_query_async
|
||||||
|
@wmi.ExecNotificationQueryAsync(@sws, @sql)
|
||||||
|
rescue => e
|
||||||
|
# No administrator privilege?
|
||||||
|
skip if /OLE error code:80041008 in SWbemServicesEx/ =~ e.message
|
||||||
|
raise
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче