summaryrefslogtreecommitdiff
path: root/test/win32ole/test_win32ole_variable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/win32ole/test_win32ole_variable.rb')
-rw-r--r--test/win32ole/test_win32ole_variable.rb18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/win32ole/test_win32ole_variable.rb b/test/win32ole/test_win32ole_variable.rb
index 826029e0a8..646cf68915 100644
--- a/test/win32ole/test_win32ole_variable.rb
+++ b/test/win32ole/test_win32ole_variable.rb
@@ -5,17 +5,25 @@ rescue LoadError
end
require "test/unit"
-if defined?(WIN32OLE_VARIABLE)
+if defined?(WIN32OLE::Variable)
class TestWIN32OLE_VARIABLE < Test::Unit::TestCase
def setup
- ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants")
+ ole_type = WIN32OLE::Type.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants")
@var1 = ole_type.variables.find {|v| v.name == 'ssfDESKTOP'}
- variables = WIN32OLE_TYPE.new("Microsoft Windows Installer Object Library", "Installer").variables
+ variables = WIN32OLE::Type.new("Microsoft Windows Installer Object Library", "Installer").variables
@var2 = variables.find {|v| v.name == 'UILevel'}
end
+ def test_toplevel_constants_backward_compatibility
+ assert_equal(WIN32OLE::Variable, ::WIN32OLE_VARIABLE)
+ end
+
+ def test_initialize
+ assert_raise(TypeError) {WIN32OLE::Variable.new}
+ end
+
def test_name
assert_equal('ssfDESKTOP', @var1.name)
end
@@ -54,8 +62,8 @@ if defined?(WIN32OLE_VARIABLE)
end
def test_inspect
- assert_equal("#<WIN32OLE_VARIABLE:ssfDESKTOP=0>", @var1.inspect)
- assert_equal("#<WIN32OLE_VARIABLE:UILevel=nil>", @var2.inspect)
+ assert_equal("#<WIN32OLE::Variable:ssfDESKTOP=0>", @var1.inspect)
+ assert_equal("#<WIN32OLE::Variable:UILevel=nil>", @var2.inspect)
end
end