ruby-changes:53201
From: suke <ko1@a...>
Date: Sun, 28 Oct 2018 15:37:39 +0900 (JST)
Subject: [ruby-changes:53201] suke:r65416 (trunk): require fixtures/classes only when platform is windows.
suke 2018-10-28 15:37:33 +0900 (Sun, 28 Oct 2018) New Revision: 65416 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65416 Log: require fixtures/classes only when platform is windows. * spec/ruby/library/win32ole/fixtures/classes.rb: remove rescue block because this file is required when platform is Windows. * spec/ruby/library/win32ole/win32ole/_getproperty_spec.rb: fixtures/classes is required when platform is Windows * spec/ruby/library/win32ole/win32ole/_invoke_spec.rb: ditto. * spec/ruby/library/win32ole/win32ole/codepage_spec.rb: ditto. * spec/ruby/library/win32ole/win32ole/connect_spec.rb: ditto. * spec/ruby/library/win32ole/win32ole/const_load_spec.rb: ditto. * spec/ruby/library/win32ole/win32ole/constants_spec.rb: ditto. * spec/ruby/library/win32ole/win32ole/create_guid_spec.rb: ditto. * spec/ruby/library/win32ole/win32ole/invoke_spec.rb: ditto. * spec/ruby/library/win32ole/win32ole/locale_spec.rb: ditto. * spec/ruby/library/win32ole/win32ole/new_spec.rb: ditto. * spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb: ditto. * spec/ruby/library/win32ole/win32ole/ole_get_methods_spec.rb: ditto. Modified files: trunk/spec/ruby/library/win32ole/fixtures/classes.rb trunk/spec/ruby/library/win32ole/win32ole/_getproperty_spec.rb trunk/spec/ruby/library/win32ole/win32ole/_invoke_spec.rb trunk/spec/ruby/library/win32ole/win32ole/codepage_spec.rb trunk/spec/ruby/library/win32ole/win32ole/connect_spec.rb trunk/spec/ruby/library/win32ole/win32ole/const_load_spec.rb trunk/spec/ruby/library/win32ole/win32ole/constants_spec.rb trunk/spec/ruby/library/win32ole/win32ole/create_guid_spec.rb trunk/spec/ruby/library/win32ole/win32ole/invoke_spec.rb trunk/spec/ruby/library/win32ole/win32ole/locale_spec.rb trunk/spec/ruby/library/win32ole/win32ole/new_spec.rb trunk/spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb trunk/spec/ruby/library/win32ole/win32ole/ole_get_methods_spec.rb Index: spec/ruby/library/win32ole/win32ole/locale_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/locale_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/locale_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/locale_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE.locale" do it "gets locale" do Index: spec/ruby/library/win32ole/win32ole/ole_get_methods_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/ole_get_methods_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/ole_get_methods_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/ole_get_methods_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE#ole_get_methods" do Index: spec/ruby/library/win32ole/win32ole/codepage_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/codepage_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/codepage_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/codepage_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE.codepage=" do it "sets codepage" do Index: spec/ruby/library/win32ole/win32ole/create_guid_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/create_guid_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/create_guid_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/create_guid_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE.create_guid" do it "generates guid with valid format" do Index: spec/ruby/library/win32ole/win32ole/constants_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/constants_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/constants_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/constants_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE class" do it "defines constant CP_ACP" do Index: spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE#ole_func_methods" do before :each do Index: spec/ruby/library/win32ole/win32ole/_getproperty_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/_getproperty_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/_getproperty_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/_getproperty_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE#_getproperty" do before :each do Index: spec/ruby/library/win32ole/win32ole/const_load_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/const_load_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/const_load_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/const_load_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE.const_load when passed Shell.Application OLE object" do before :each do Index: spec/ruby/library/win32ole/win32ole/connect_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/connect_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/connect_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/connect_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE.connect" do it "creates WIN32OLE object given valid argument" do Index: spec/ruby/library/win32ole/win32ole/new_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/new_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/new_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/new_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLESpecs.new_ole" do it "creates a WIN32OLE object from OLE server name" do Index: spec/ruby/library/win32ole/win32ole/_invoke_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/_invoke_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/_invoke_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/_invoke_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE#_invoke" do before :each do Index: spec/ruby/library/win32ole/win32ole/invoke_spec.rb =================================================================== --- spec/ruby/library/win32ole/win32ole/invoke_spec.rb (revision 65415) +++ spec/ruby/library/win32ole/win32ole/invoke_spec.rb (revision 65416) @@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/invoke_spec.rb#L1 -require_relative '../fixtures/classes' - platform_is :windows do - require 'win32ole' + require_relative '../fixtures/classes' describe "WIN32OLE#invoke" do before :each do Index: spec/ruby/library/win32ole/fixtures/classes.rb =================================================================== --- spec/ruby/library/win32ole/fixtures/classes.rb (revision 65415) +++ spec/ruby/library/win32ole/fixtures/classes.rb (revision 65416) @@ -1,14 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/fixtures/classes.rb#L1 -begin - require 'win32ole' -rescue LoadError -end +require 'win32ole' module WIN32OLESpecs - begin - MSXML_AVAILABLE = !!WIN32OLE_TYPELIB.typelibs.find { |t| t.name.start_with?('Microsoft XML') } - rescue - MSXML_AVAILABLE = false - end + MSXML_AVAILABLE = !!WIN32OLE_TYPELIB.typelibs.find { |t| t.name.start_with?('Microsoft XML') } def self.new_ole(name) tries = 0 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/