mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add some test. update comment for rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d9591028f2
commit
b84ff5ccb3
3 changed files with 45 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
|||
Sun Jan 7 17:47:16 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||
|
||||
* test/win32ole/test_win32ole.rb: add test for WIN32OLE#[],
|
||||
WIN32OLE#[]=.
|
||||
|
||||
* ext/win32ole/win32ole.c: update comment for rdoc of
|
||||
WIN32OLE#[] and WIN32OLE#[]=.
|
||||
|
||||
Sun Jan 7 12:13:26 2007 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#find_class_comment):
|
||||
|
|
|
@ -2746,10 +2746,20 @@ fole_setproperty2(VALUE self, VALUE dispid, VALUE args, VALUE types)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* WIN32OLE['property']=val
|
||||
* WIN32OLE.setproperty('property', [arg1, arg2,...] val)
|
||||
* WIN32OLE[a1, a2, ...]=val
|
||||
*
|
||||
* Sets property of OLE object.
|
||||
* Sets the value to WIN32OLE object specified by a1, a2, ...
|
||||
*
|
||||
* dict = WIN32OLE.new('Scripting.Dictionary')
|
||||
* dict.add('ruby', 'RUBY')
|
||||
* dict['ruby'] = 'Ruby'
|
||||
* puts dict['ruby'] # => 'Ruby'
|
||||
*
|
||||
* Remark: You can not use this method to set the property value.
|
||||
*
|
||||
* excel = WIN32OLE.new('Excel.Application')
|
||||
* # excel['Visible'] = true # This is error !!!
|
||||
* excel.Visible = true # You should to use this style to set the property.
|
||||
*
|
||||
*/
|
||||
static VALUE
|
||||
|
@ -2780,12 +2790,19 @@ fole_setproperty(int argc, VALUE *argv, VALUE self)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* WIN32OLE['property']
|
||||
* WIN32OLE[a1,a2,...]
|
||||
*
|
||||
* Returns property of OLE object.
|
||||
* Returns the value of Collection specified by a1, a2,....
|
||||
*
|
||||
* dict = WIN32OLE.new('Scripting.Dictionary')
|
||||
* dict.add('ruby', 'Ruby')
|
||||
* puts dict['ruby'] # => 'Ruby' (same as `puts dict.item('ruby')')
|
||||
*
|
||||
* Remark: You can not use this method to get the property.
|
||||
* excel = WIN32OLE.new('Excel.Application')
|
||||
* puts excel['Visible'] # => false
|
||||
* # puts excel['Visible'] This is error !!!
|
||||
* puts excel.Visible # You should to use this style to get the property.
|
||||
*
|
||||
*/
|
||||
static VALUE
|
||||
fole_getproperty_with_bracket(int argc, VALUE *argv, VALUE self)
|
||||
|
|
|
@ -40,5 +40,19 @@ if defined?(WIN32OLE)
|
|||
name = folder.getDetailsOf({"vItem" => item, :iColumn => 0})
|
||||
assert_equal(item.name, name)
|
||||
end
|
||||
|
||||
def test_bracket
|
||||
dict = WIN32OLE.new('Scripting.Dictionary')
|
||||
dict.add("foo", "FOO")
|
||||
assert_equal("FOO", dict.item("foo"))
|
||||
assert_equal("FOO", dict["foo"])
|
||||
end
|
||||
|
||||
def test_bracket_equal
|
||||
dict = WIN32OLE.new('Scripting.Dictionary')
|
||||
dict.add("foo", "FOO")
|
||||
dict["foo"] = "BAR"
|
||||
assert_equal("BAR", dict["foo"])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue