diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/win32ole/test_folderitem2_invokeverb.rb | 5 | ||||
-rw-r--r-- | test/win32ole/test_win32ole_type.rb | 14 | ||||
-rw-r--r-- | test/win32ole/test_win32ole_typelib.rb | 10 |
3 files changed, 22 insertions, 7 deletions
diff --git a/test/win32ole/test_folderitem2_invokeverb.rb b/test/win32ole/test_folderitem2_invokeverb.rb index a4e90fb66..853b05bed 100644 --- a/test/win32ole/test_folderitem2_invokeverb.rb +++ b/test/win32ole/test_folderitem2_invokeverb.rb @@ -29,7 +29,7 @@ if defined?(WIN32OLE) @shortcut = nil # - # Search the 'Create Shortcut (&S)' string. + # Search the 'Create Shortcut (&S)' string in Japanese. # Yes, I know the string in the Windows 2000 Japanese Edition. # But I do not know about the string in any other Windows. # @@ -38,7 +38,8 @@ if defined?(WIN32OLE) @shortcut = verbs.collect{|verb| verb.name }.find {|name| - /.*\(\&S\)$/ =~ name + name.unpack("C*") == [131, 86, 131, 135, 129, 91, 131, 103, 131, 74, 131, 98, 131, 103, 130, 204, 141, 236, 144, 172, 40, 38, 83, 41] + # /.*\(\&S\)$/ =~ name } end diff --git a/test/win32ole/test_win32ole_type.rb b/test/win32ole/test_win32ole_type.rb index 3ef62b10d..a5b59ca47 100644 --- a/test/win32ole/test_win32ole_type.rb +++ b/test/win32ole/test_win32ole_type.rb @@ -158,6 +158,20 @@ if defined?(WIN32OLE_TYPE) def test_inspect assert_equal("#<WIN32OLE_TYPE:Shell>", @ole_type.inspect) end + # WIN32OLE_TYPE.typelibs will be obsoleted. + def test_s_typelibs + tlibs = WIN32OLE_TYPE.typelibs.sort + tlibs2 = WIN32OLE_TYPELIB.typelibs.collect{|t|t.name}.sort + assert_equal(tlibs2, tlibs) + end + # WIN32OLE_TYPE.ole_classes will be obsoleted. + def test_s_ole_classes + ots1 = WIN32OLE_TYPE.ole_classes("Microsoft Shell Controls And Automation") + ots2 = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation").ole_types + otns1 = ots1.collect{|t| t.name}.sort + otns2 = ots2.collect{|t| t.name}.sort + assert_equal(otns2, otns1) + end end end diff --git a/test/win32ole/test_win32ole_typelib.rb b/test/win32ole/test_win32ole_typelib.rb index 2da50d929..16e6c1a66 100644 --- a/test/win32ole/test_win32ole_typelib.rb +++ b/test/win32ole/test_win32ole_typelib.rb @@ -88,12 +88,12 @@ if defined?(WIN32OLE_TYPELIB) assert_equal("Microsoft Shell Controls And Automation", tlib.to_s) end - def test_ole_classes + def test_ole_types tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation") - ole_classes = tlib.ole_classes - assert_instance_of(Array, ole_classes) - assert(ole_classes.size > 0) - assert_instance_of(WIN32OLE_TYPE, ole_classes[0]) + ole_types = tlib.ole_types + assert_instance_of(Array, ole_types) + assert(ole_types.size > 0) + assert_instance_of(WIN32OLE_TYPE, ole_types[0]) end def test_inspect |