mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge win32ole from rough
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
95a5a67142
commit
f14180707d
32 changed files with 14163 additions and 0 deletions
42
ext/win32ole/tests/testOLEVARIABLE.rb
Normal file
42
ext/win32ole/tests/testOLEVARIABLE.rb
Normal file
|
@ -0,0 +1,42 @@
|
|||
# You need RubyUnit and MS Excel and MSI to run this test script
|
||||
|
||||
require 'rubyunit'
|
||||
|
||||
require 'win32ole'
|
||||
require 'oleserver'
|
||||
|
||||
class TestOLEVARIABLE < RUNIT::TestCase
|
||||
include OLESERVER
|
||||
def test_name
|
||||
classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
|
||||
chart = classes.find {|c| c.name == 'XlChartType'}
|
||||
var_names = chart.variables.collect {|m| m.name}
|
||||
assert(var_names.size > 0)
|
||||
assert(var_names.include?('xl3DColumn'))
|
||||
end
|
||||
def test_ole_type
|
||||
classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
|
||||
chart = classes.find {|c| c.name == 'XlChartType'}
|
||||
var = chart.variables.find {|m| m.name == 'xl3DColumn'}
|
||||
assert_equal('INT', var.ole_type)
|
||||
end
|
||||
def test_ole_type_detail
|
||||
classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
|
||||
chart = classes.find {|c| c.name == 'XlChartType'}
|
||||
var = chart.variables.find {|m| m.name == 'xl3DColumn'}
|
||||
assert_equal(['INT'], var.ole_type_detail)
|
||||
end
|
||||
|
||||
def test_value
|
||||
classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
|
||||
chart = classes.find {|c| c.name == 'XlChartType'}
|
||||
var = chart.variables.find {|m| m.name == 'xl3DColumn'}
|
||||
assert_equal(-4100, var.value)
|
||||
end
|
||||
def test_visible
|
||||
classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
|
||||
chart = classes.find {|c| c.name == 'XlChartType'}
|
||||
var = chart.variables.find {|m| m.name == 'xl3DColumn'}
|
||||
assert(var.visible?)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue