diff options
-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 |