diff options
Diffstat (limited to 'ext/win32ole/tests/testOLETYPE.rb')
-rw-r--r-- | ext/win32ole/tests/testOLETYPE.rb | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/ext/win32ole/tests/testOLETYPE.rb b/ext/win32ole/tests/testOLETYPE.rb deleted file mode 100644 index 510691484f..0000000000 --- a/ext/win32ole/tests/testOLETYPE.rb +++ /dev/null @@ -1,111 +0,0 @@ -# You need RubyUnit and MS Excel and MSI to run this test script - -require 'rubyunit' - -require 'win32ole' -require 'oleserver' - -class TestOLETYPE < RUNIT::TestCase - include OLESERVER - def test_s_new - type = WIN32OLE_TYPE.new(MS_EXCEL_TYPELIB, 'Application') - assert_instance_of(WIN32OLE_TYPE, type) - end - def test_s_ole_classes - classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB) - assert(classes.size > 0) - end - def test_s_typelibs - libs = WIN32OLE_TYPE.typelibs - assert(libs.include?(MS_EXCEL_TYPELIB)) - assert(libs.include?(MS_XML_TYPELIB)) - end - def test_s_progids - progids = WIN32OLE_TYPE.progids - assert(progids.include?('Excel.Application')) - end - def test_name - classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB) - class_names = classes.collect{|c| - c.name - } - assert(class_names.include?('Application')) - end - - def test_class_to_s - classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB) - class_names = classes.collect{|c| - "#{c}" - } - assert(class_names.include?('Application')) - end - - def test_ole_type - classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB) - app = classes.find {|c| c.name == 'Application'} - assert_equal('Class', app.ole_type) - app = classes.find {|c| c.name == '_Application'} - assert_equal('Dispatch', app.ole_type) - end - def test_typekind - classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB) - app = classes.find {|c| c.name == 'Application'} - assert_equal(5, app.typekind) - end - def test_visible - classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB) - app = classes.find {|c| c.name == 'Application'} - assert(app.visible?) - app = classes.find {|c| c.name == 'IAppEvents'} - assert(!app.visible?) - end - def test_src_type - classes = WIN32OLE_TYPE.ole_classes(MS_XML_TYPELIB) - domnode = classes.find {|c| c.name == 'DOMNodeType'} - assert_equal('tagDOMNodeType', domnode.src_type) - end - def test_helpstring - classes = WIN32OLE_TYPE.ole_classes(MS_XML_TYPELIB) - domdoc = classes.find {|c| c.name == 'DOMDocument'} - assert_equal('W3C-DOM XML Document', domdoc.helpstring) - end - def test_variables - classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB) - xlchart = classes.find {|c| c.name == 'XlChartType'} - assert(xlchart.variables.size > 0) - end - def test_ole_methods - classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB) - worksheet = classes.find {|c| c.name == 'Worksheet'} - assert(worksheet.ole_methods.size > 0) - end - def test_helpfile - classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB) - worksheet = classes.find {|c| c.name == 'Worksheet'} - assert_match(/VBAXL.*\.(CHM|HLP)$/, worksheet.helpfile) - end - def test_helpcontext - classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB) - worksheet = classes.find {|c| c.name == 'Worksheet'} - assert_equal(131088, worksheet.helpcontext) - end - def test_to_s - type = WIN32OLE_TYPE.new(MS_EXCEL_TYPELIB, 'Application') - assert_equal("Application", "#{type}"); - end - def test_ole_typelib - type = WIN32OLE_TYPE.new(MS_EXCEL_TYPELIB, 'Application') - tlib = type.ole_typelib - assert_instance_of(WIN32OLE_TYPELIB, tlib); - assert_equal(MS_EXCEL_TYPELIB, tlib.name); - end - - def test_implemented_ole_types - type = WIN32OLE_TYPE.new(MS_EXCEL_TYPELIB, 'Application') - impltypes = type.implemented_ole_types - assert_instance_of(Array, impltypes); - assert_equal('_Application', impltypes[0].name) - assert_equal('AppEvents', impltypes[1].name) - end - -end |