Class: TestOLEMETHOD
- Inherits:
-
RUNIT::TestCase
- Object
- RUNIT::TestCase
- TestOLEMETHOD
show all
- Includes:
- OLESERVER
- Defined in:
- tests/testOLEMETHOD.rb
Constant Summary
Constants included
from OLESERVER
OLESERVER::MS_EXCEL_TYPELIB, OLESERVER::MS_XML_TYPELIB
Instance Method Summary
collapse
Instance Method Details
#test_dispid ⇒ Object
87
88
89
90
91
|
# File 'tests/testOLEMETHOD.rb', line 87
def test_dispid
tobj = WIN32OLE_TYPE.new('Microsoft Shell Controls And Automation', 'FolderItem2')
method = WIN32OLE_METHOD.new(tobj, 'InvokeVerb')
assert_equal(1610743824, method.dispid)
end
|
#test_event ⇒ Object
58
59
60
61
62
63
|
# File 'tests/testOLEMETHOD.rb', line 58
def test_event
m = WIN32OLE_METHOD.new(@excel_app, 'WorkbookOpen')
assert(m.event?)
m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
assert(!m.event?)
end
|
#test_event_interface ⇒ Object
64
65
66
67
68
69
|
# File 'tests/testOLEMETHOD.rb', line 64
def test_event_interface
m = WIN32OLE_METHOD.new(@excel_app, 'WorkbookOpen')
assert_equal('AppEvents', m.event_interface)
m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
assert_nil(m.event_interface)
end
|
#test_helpcontext ⇒ Object
79
80
81
82
|
# File 'tests/testOLEMETHOD.rb', line 79
def test_helpcontext
m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
assert(m.helpcontext > 0)
end
|
#test_helpfile ⇒ Object
75
76
77
78
|
# File 'tests/testOLEMETHOD.rb', line 75
def test_helpfile
m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
assert_match(/VBAXL.*\.(HLP|CHM)$/i, m.helpfile)
end
|
#test_helpstring ⇒ Object
#test_invoke_kind ⇒ Object
48
49
50
51
|
# File 'tests/testOLEMETHOD.rb', line 48
def test_invoke_kind
m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
assert_equal('PROPERTYGET', m.invoke_kind)
end
|
#test_name ⇒ Object
21
22
23
24
|
# File 'tests/testOLEMETHOD.rb', line 21
def test_name
m = WIN32OLE_METHOD.new(@excel_app, 'Quit')
assert_equal('Quit', m.name)
end
|
#test_offset_vtbl ⇒ Object
83
84
85
86
|
# File 'tests/testOLEMETHOD.rb', line 83
def test_offset_vtbl
m = WIN32OLE_METHOD.new(@excel_app, 'QueryInterface')
assert_equal(0, m.offset_vtbl)
end
|
#test_return_type ⇒ Object
29
30
31
32
33
34
|
# File 'tests/testOLEMETHOD.rb', line 29
def test_return_type
m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
assert_equal('Range', m.return_type)
m = WIN32OLE_METHOD.new(@excel_app, 'ActivePrinter')
assert_equal('BSTR', m.return_type)
end
|
#test_return_type_detail ⇒ Object
41
42
43
44
45
46
|
# File 'tests/testOLEMETHOD.rb', line 41
def test_return_type_detail
m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
assert_equal(['PTR', 'USERDEFINED', 'Range'], m.return_type_detail)
m = WIN32OLE_METHOD.new(@excel_app, 'ActivePrinter')
assert_equal(['BSTR'], m.return_type_detail)
end
|
#test_return_vtype ⇒ Object
#test_to_s ⇒ Object
25
26
27
28
|
# File 'tests/testOLEMETHOD.rb', line 25
def test_to_s
m = WIN32OLE_METHOD.new(@excel_app, 'Quit')
assert_equal('Quit', "#{m}")
end
|
#test_visible ⇒ Object
52
53
54
55
56
57
|
# File 'tests/testOLEMETHOD.rb', line 52
def test_visible
m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
assert(m.visible?)
m = WIN32OLE_METHOD.new(@excel_app, 'AddRef')
assert(!m.visible?)
end
|