summaryrefslogtreecommitdiff
path: root/test/win32ole
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-08 08:19:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-08 08:19:32 +0000
commit311960cdaf4e884643235fe83a3970b5e1f5ba47 (patch)
tree0575c47a703cb5a6a1df40b6a1626bbeacdc249f /test/win32ole
parent418b8e121c1e8312cdead70e5acb2d14e1a40639 (diff)
win32ole.c: check arity
* ext/win32ole/win32ole.c (fole_missing): should check actual argument count before accessing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/win32ole')
-rw-r--r--test/win32ole/test_win32ole.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb
index 40b6a81544..5b237370b5 100644
--- a/test/win32ole/test_win32ole.rb
+++ b/test/win32ole/test_win32ole.rb
@@ -495,6 +495,13 @@ if defined?(WIN32OLE)
def test_const_LOCALE_USER_DEFAULT
assert_equal(0x0400, WIN32OLE::LOCALE_USER_DEFAULT);
end
+
+ def test_method_missing
+ assert_raise(ArgumentError) {@dict1.method_missing}
+ assert_raise(TypeError) {@dict1.method_missing(1)}
+ assert_raise(ArgumentError) {@dict1.method_missing("foo=")}
+ assert_raise(ArgumentError) {@dict1.method_missing("foo=", 1, 2)}
+ end
end
# test of subclass of WIN32OLE