[前][次][番号順一覧][スレッド一覧]

ruby-changes:53190

From: suke <ko1@a...>
Date: Sun, 28 Oct 2018 12:48:24 +0900 (JST)
Subject: [ruby-changes:53190] suke:r65405 (trunk): use Scripting.Dictionary instead of InternetExplorer.Application

suke	2018-10-28 12:48:17 +0900 (Sun, 28 Oct 2018)

  New Revision: 65405

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65405

  Log:
    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).

  Modified files:
    trunk/spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb
    trunk/spec/ruby/library/win32ole/win32ole/ole_method_spec.rb
    trunk/spec/ruby/library/win32ole/win32ole/shared/ole_method.rb
Index: spec/ruby/library/win32ole/win32ole/ole_method_spec.rb
===================================================================
--- spec/ruby/library/win32ole/win32ole/ole_method_spec.rb	(revision 65404)
+++ spec/ruby/library/win32ole/win32ole/ole_method_spec.rb	(revision 65405)
@@ -1,8 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/ole_method_spec.rb#L1
-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
Index: spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb
===================================================================
--- spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb	(revision 65404)
+++ spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb	(revision 65405)
@@ -1,8 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb#L1
-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
Index: spec/ruby/library/win32ole/win32ole/shared/ole_method.rb
===================================================================
--- spec/ruby/library/win32ole/win32ole/shared/ole_method.rb	(revision 65404)
+++ spec/ruby/library/win32ole/win32ole/shared/ole_method.rb	(revision 65405)
@@ -1,25 +1,19 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/shared/ole_method.rb#L1
-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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]