зеркало из https://github.com/github/ruby.git
refactoring define AvailableOLE.sysmon_available?
* test/win32ole/test_win32ole_type_event.rb: refactoring. use AvailableOLE.sysmon_available? * test/win32ole/available_ole.rb: define AvailableOLE.sysmon_available? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
39a840d084
Коммит
2fe69b221c
|
@ -0,0 +1,17 @@
|
|||
begin
|
||||
require 'win32ole'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
if defined?(WIN32OLE)
|
||||
module AvailableOLE
|
||||
module_function
|
||||
|
||||
def sysmon_available?
|
||||
WIN32OLE_TYPE.new('System Monitor Control', 'SystemMonitor')
|
||||
true
|
||||
rescue
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
|
@ -7,15 +7,10 @@ end
|
|||
require 'test/unit'
|
||||
|
||||
if defined?(WIN32OLE_TYPE)
|
||||
def sysmon_available?
|
||||
WIN32OLE_TYPE.new('System Monitor Control', 'SystemMonitor')
|
||||
true
|
||||
rescue
|
||||
false
|
||||
end
|
||||
require_relative 'available_ole'
|
||||
|
||||
class TestWIN32OLE_TYPE_EVENT < Test::Unit::TestCase
|
||||
unless sysmon_available?
|
||||
unless AvailableOLE.sysmon_available?
|
||||
def test_dummy_for_skip_message
|
||||
skip 'System Monitor Control is not available'
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче