diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-28 03:48:17 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-28 03:48:17 +0000 |
commit | d7d83fa0cf5202bc6aca917a82575f0e42cd4432 (patch) | |
tree | 578962873670473572b5877883d326f0c26cb0d4 /spec | |
parent | 15533bb40a1fc9a939426ccae39bae1683506af2 (diff) | |
download | ruby-d7d83fa0cf5202bc6aca917a82575f0e42cd4432.tar.gz |
use Scripting.Dictionary instead of InternetExplorer.Application
* spec/ruby/library/win32ole/win32ole/ole_method_spec.rb: recuire in
platform_is block.
* spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb: ditto.
* spec/ruby/library/win32ole/win32ole/shared/ole_method.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@65405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
3 files changed, 10 insertions, 20 deletions
diff --git a/spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb b/spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb index 3f2083225f..8a26d79a20 100644 --- a/spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb +++ b/spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb @@ -1,8 +1,6 @@ -require_relative '../fixtures/classes' -require_relative 'shared/ole_method' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' + require_relative 'shared/ole_method' describe "WIN32OLE#ole_method_help" do it_behaves_like :win32ole_ole_method, :ole_method_help diff --git a/spec/ruby/library/win32ole/win32ole/ole_method_spec.rb b/spec/ruby/library/win32ole/win32ole/ole_method_spec.rb index 7b7be496c9..f82a212f5d 100644 --- a/spec/ruby/library/win32ole/win32ole/ole_method_spec.rb +++ b/spec/ruby/library/win32ole/win32ole/ole_method_spec.rb @@ -1,8 +1,6 @@ -require_relative '../fixtures/classes' -require_relative 'shared/ole_method' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' + require_relative 'shared/ole_method' describe "WIN32OLE#ole_method" do it_behaves_like :win32ole_ole_method, :ole_method diff --git a/spec/ruby/library/win32ole/win32ole/shared/ole_method.rb b/spec/ruby/library/win32ole/win32ole/shared/ole_method.rb index 33268e0aa2..26566a0b14 100644 --- a/spec/ruby/library/win32ole/win32ole/shared/ole_method.rb +++ b/spec/ruby/library/win32ole/win32ole/shared/ole_method.rb @@ -1,25 +1,19 @@ -require_relative '../../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../../fixtures/classes' describe :win32ole_ole_method, 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 "returns the WIN32OLE_METHOD 'Quit' if given 'Quit'" do - result = @ie.send(@method, "Quit") + it "returns the WIN32OLE_METHOD 'Add' if given 'Add'" do + result = @dict.send(@method, "Add") result.kind_of?(WIN32OLE_METHOD).should be_true - result.name.should == 'Quit' + result.name.should == 'Add' end end end |