summaryrefslogtreecommitdiff
path: root/test/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-27 01:51:54 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-27 01:51:54 +0000
commitb3c318bffd951d7ea4b35bbc2a3c8d6c6d190716 (patch)
treef7d2b0e5213697bd0f9cef736e4e2419d1cbb9b4 /test/win32ole
parent4d4ed5640c73f5be7920778b009b168beb10061e (diff)
* ext/win32ole/win32ole.c (foleparam_initialize): add foleparam_initialize
to check argument of WIN32OLE_PARAM.new * test/win32ole/test_win32ole_param.rb (test_s_new): add some assertion to test WIN32OLE_PARAM.new git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/win32ole')
-rw-r--r--test/win32ole/test_win32ole_param.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/win32ole/test_win32ole_param.rb b/test/win32ole/test_win32ole_param.rb
index 3b831c3937..1a4eeff301 100644
--- a/test/win32ole/test_win32ole_param.rb
+++ b/test/win32ole/test_win32ole_param.rb
@@ -33,9 +33,24 @@ if defined?(WIN32OLE_PARAM)
assert_raise(ArgumentError) {
WIN32OLE_PARAM.new("hoge")
}
+ ole_type = WIN32OLE_TYPE.new("Microsoft Scripting Runtime", "FileSystemObject")
+ m_copyfile = WIN32OLE_METHOD.new(ole_type, "CopyFile")
+ assert_raise(IndexError) {
+ WIN32OLE_PARAM.new(m_copyfile, 4);
+ }
+ assert_raise(IndexError) {
+ WIN32OLE_PARAM.new(m_copyfile, 0);
+ }
+ assert_raise(IndexError) {
+ WIN32OLE_PARAM.new(m_copyfile, 0);
+ }
+ param = WIN32OLE_PARAM.new(m_copyfile, 3)
+ assert_equal("OverWriteFiles", param.name)
+ assert_equal(WIN32OLE_PARAM, param.class)
+ assert_equal(true, param.default)
+ assert_equal("#<WIN32OLE_PARAM:OverWriteFiles=true>", param.inspect)
end
-
def test_name
assert_equal('URL', @param_url.name)
assert_equal('Flags', @param_flags.name)