diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-15 14:11:02 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-15 14:11:02 +0000 |
commit | 20359b9bb2d678e409ebf929aa21285d260cbf12 (patch) | |
tree | 0729f3c2ae91066bb24ee9223d19ada17838f216 /ext/win32ole | |
parent | 72e8f4fd3f58efecccd732bf6f60490176c99732 (diff) |
The return value of WIN32OLE#ole_methods and WIN32OLE#ole_put_methods
should include PROPERTYPUTREF methods.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r-- | ext/win32ole/tests/test_ole_methods.rb | 36 | ||||
-rw-r--r-- | ext/win32ole/tests/testall.rb | 1 | ||||
-rw-r--r-- | ext/win32ole/win32ole.c | 6 |
3 files changed, 40 insertions, 3 deletions
diff --git a/ext/win32ole/tests/test_ole_methods.rb b/ext/win32ole/tests/test_ole_methods.rb new file mode 100644 index 0000000000..4b777a7eba --- /dev/null +++ b/ext/win32ole/tests/test_ole_methods.rb @@ -0,0 +1,36 @@ +# +# This is test for [ruby-talk:196897] +# +begin + require 'win32ole' +rescue LoadError +end +require "test/unit" + +if defined?(WIN32OLE) + class TestWIN32OLE < Test::Unit::TestCase + + def setup + @obj = WIN32OLE.new('Scripting.Dictionary') + end + + def test_ole_methods + x = @obj.ole_methods.select {|m| + m.invoke_kind == 'PROPERTYPUTREF' + } + assert(x.size > 0) + assert_equal(1, x.size) + assert_equal('Item', x[0].name) + end + + def test_ole_put_methods + x = @obj.ole_put_methods.select {|m| + m.invoke_kind == 'PROPERTYPUTREF' + } + assert(x.size > 0) + assert_equal(1, x.size) + assert_equal('Item', x[0].name) + end + + end +end diff --git a/ext/win32ole/tests/testall.rb b/ext/win32ole/tests/testall.rb index 4835bac748..2ae4a88986 100644 --- a/ext/win32ole/tests/testall.rb +++ b/ext/win32ole/tests/testall.rb @@ -9,4 +9,5 @@ require "testOLEMETHOD" require "testOLEVARIABLE" require "testVARIANT" require "testNIL2VTEMPTY" +require "test_ole_methods.rb" # require "testOLEEVENT" diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index f567fade37..cb6b1673d3 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -78,7 +78,7 @@ #define WC2VSTR(x) ole_wc2vstr((x), TRUE) -#define WIN32OLE_VERSION "0.6.6" +#define WIN32OLE_VERSION "0.6.7" typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX) (REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*); @@ -2914,7 +2914,7 @@ static VALUE fole_methods( self ) VALUE self; { - return ole_methods( self, INVOKE_FUNC | INVOKE_PROPERTYGET | INVOKE_PROPERTYPUT); + return ole_methods( self, INVOKE_FUNC | INVOKE_PROPERTYGET | INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF); } /* @@ -2948,7 +2948,7 @@ static VALUE fole_put_methods( self ) VALUE self; { - return ole_methods( self, INVOKE_PROPERTYPUT); + return ole_methods( self, INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF); } /* |