mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
df45be0472
commit
c3a13f6cc4
3 changed files with 16 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue