summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--ext/win32ole/win32ole.c4
-rw-r--r--test/win32ole/test_win32ole.rb7
3 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5dbc4df3da..0bf82ec0ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu May 20 20:47:46 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_invoke): raise NoMethodError
+ when COM method is not found. [ruby-core:30160] [Bug #3277]
+
+ * test/win32ole/test_win32ole.rb (test_no_method_error): ditto.
+
Thu May 20 16:17:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/psych/emitter: C99(gcc)-ism.
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index ce288f3b95..f92c0dd4b6 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -130,7 +130,7 @@ const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00,
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "1.4.7"
+#define WIN32OLE_VERSION "1.4.8"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -3347,7 +3347,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
&wcmdname, 1, lcid, &DispID);
SysFreeString(wcmdname);
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, rb_eNoMethodError,
"unknown property or method: `%s'",
StringValuePtr(cmd));
}
diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb
index 8c8528fde3..8d72272b9c 100644
--- a/test/win32ole/test_win32ole.rb
+++ b/test/win32ole/test_win32ole.rb
@@ -55,6 +55,13 @@ if defined?(WIN32OLE)
assert_match(/^\(in setting property `compareMode': \)/, exc.message) #`
end
+ def test_no_method_error
+ exc = assert_raise(NoMethodError) {
+ @dict1.non_exist_method
+ }
+ assert_match(/non_exist_method/, exc.message)
+ end
+
def test_ole_methods
methods = @dict1.ole_methods
mnames = methods.collect {|m|