1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/win32ole/win32ole.c (fole_s_connect, fole_initialize,

folevariant_initialize): check argument type of WIN32OLE.connect,
  WIN32OLE.new, WIN32OLE_VARIANT.new.

* test/win32ole/test_win32ole.rb (test_s_new_exc, test_s_connect_exc):
  ditto.

* test/win32ole/test_win32ole_variant.rb (test_s_new_exc): ditto.

* test/win32ole/test_win32ole_method.rb: add assertion of
  WIN32OLE_METHOD.new.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
suke 2008-11-06 12:38:49 +00:00
parent 0ca8c28e4d
commit 696e6a9b76
5 changed files with 62 additions and 1 deletions

View file

@ -153,6 +153,15 @@ if defined?(WIN32OLE)
assert_instance_of(WIN32OLE, @dict2)
end
def test_s_new_exc
assert_raise(TypeError) {
WIN32OLE.new(1)
}
assert_raise(TypeError) {
WIN32OLE.new("Scripting.Dictionary", 1)
}
end
def test_s_new_DCOM
rshell = WIN32OLE.new("Shell.Application")
assert_instance_of(WIN32OLE, rshell)
@ -172,6 +181,12 @@ if defined?(WIN32OLE)
assert_instance_of(WIN32OLE, obj)
end
def test_s_connect_exc
assert_raise(TypeError) {
WIN32OLE.connect(1)
}
end
def test_invoke_accept_symbol_hash_key
fso = WIN32OLE.new('Scripting.FileSystemObject')
afolder = fso.getFolder(".")