diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-28 05:08:37 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-28 05:08:37 +0000 |
commit | ef929bc67b5c46c85ae9451145420a4b408c90cf (patch) | |
tree | b35faea905e3252eca09106d055d6317d29e1efb /spec/ruby | |
parent | 7f0aefec6a2460e3ed0a8ace4a9f4c09dc145d60 (diff) | |
download | ruby-ef929bc67b5c46c85ae9451145420a4b408c90cf.tar.gz |
use Scripting.Dictionary instead of InternetExplorer.Application.
* spec/ruby/library/win32ole/win32ole/shared/setproperty.rb: use
Scripting.Dictionary. InternetExplorer.Application is not available on
some environments. Thanks to MSP-Greg (Greg L).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/library/win32ole/win32ole/setproperty_spec.rb | 6 | ||||
-rw-r--r-- | spec/ruby/library/win32ole/win32ole/shared/setproperty.rb | 22 |
2 files changed, 12 insertions, 16 deletions
diff --git a/spec/ruby/library/win32ole/win32ole/setproperty_spec.rb b/spec/ruby/library/win32ole/win32ole/setproperty_spec.rb index f6ece7af5a..7409823f20 100644 --- a/spec/ruby/library/win32ole/win32ole/setproperty_spec.rb +++ b/spec/ruby/library/win32ole/win32ole/setproperty_spec.rb @@ -1,8 +1,6 @@ -require_relative '../fixtures/classes' -require_relative 'shared/setproperty' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' + require_relative 'shared/setproperty' describe "WIN32OLE#setproperty" do it_behaves_like :win32ole_setproperty, :setproperty diff --git a/spec/ruby/library/win32ole/win32ole/shared/setproperty.rb b/spec/ruby/library/win32ole/win32ole/shared/setproperty.rb index f272da4b4e..b850d21933 100644 --- a/spec/ruby/library/win32ole/win32ole/shared/setproperty.rb +++ b/spec/ruby/library/win32ole/win32ole/shared/setproperty.rb @@ -1,25 +1,23 @@ -require_relative '../../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../../fixtures/classes' describe :win32ole_setproperty, shared: true do before :each do - @ie = WIN32OLESpecs.new_ole('InternetExplorer.Application') - end - - after :each do - @ie.Quit + @dict = WIN32OLESpecs.new_ole('Scripting.Dictionary') end it "raises ArgumentError if no argument is given" do - lambda { @ie.send(@method) }.should raise_error ArgumentError + lambda { @dict.send(@method) }.should raise_error ArgumentError end - it "sets height to 500 and returns nil" do - height = 500 - result = @ie.send(@method, 'Height', height) + it "sets key to newkey and returns nil" do + oldkey = 'oldkey' + newkey = 'newkey' + @dict.add(oldkey, 'value') + result = @dict.send(@method, 'Key', oldkey, newkey) result.should == nil + @dict[oldkey].should == nil + @dict[newkey].should == 'value' end end end |