Skip to content

Commit

Permalink
Reapply "Suppress WIN32OLE deprecation warnings for the time being"
Browse files Browse the repository at this point in the history
Revert the part of commit 10917c5,
"Update to ruby/spec@18032a7", that discarded the previous commit.
  • Loading branch information
nobu committed Jan 8, 2025
1 parent b81db53 commit 3e6f5ea
Show file tree
Hide file tree
Showing 75 changed files with 299 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/ruby/library/win32ole/fixtures/classes.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require 'win32ole'

module WIN32OLESpecs
WIN32OLERuntimeError ||= WIN32OLE::RuntimeError
WIN32OLE_TYPELIB ||= WIN32OLE::TypeLib

MSXML_AVAILABLE = WIN32OLE_TYPELIB.typelibs.any? { |t| t.name.start_with?('Microsoft XML') }
SYSTEM_MONITOR_CONTROL_AVAILABLE = WIN32OLE_TYPELIB.typelibs.any? { |t| t.name.start_with?('System Monitor Control') }

Expand Down
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/_getproperty_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE#_getproperty" do
Expand All @@ -12,4 +14,6 @@
@dict._getproperty(0, ['key'], [WIN32OLE::VARIANT::VT_BSTR]).should == 'value'
end
end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/_invoke_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE#_invoke" do
Expand All @@ -19,4 +21,6 @@

end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/codepage_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE.codepage=" do
Expand All @@ -11,4 +13,6 @@
end
end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/connect_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE.connect" do
Expand All @@ -13,4 +15,6 @@
end

end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/const_load_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE.const_load when passed Shell.Application OLE object" do
Expand Down Expand Up @@ -30,4 +32,6 @@ module WIN32OLE_RUBYSPEC; end
end
end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/constants_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE class" do
Expand Down Expand Up @@ -40,4 +42,6 @@
end
end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/create_guid_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE.create_guid" do
it "generates guid with valid format" do
WIN32OLE.create_guid.should =~ /^\{[A-Z0-9]{8}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{12}/
end
end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/invoke_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE#invoke" do
Expand All @@ -12,4 +14,6 @@
@dict.invoke('Item', 'key').should == 'value'
end
end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/locale_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE.locale" do
Expand Down Expand Up @@ -27,4 +29,6 @@
end
end
end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/new_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLESpecs.new_ole" do
Expand All @@ -23,4 +25,6 @@

end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE#ole_func_methods" do
Expand All @@ -19,4 +21,6 @@
@dict.ole_func_methods.map { |m| m.name }.include?('AddRef').should be_true
end
end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/ole_get_methods_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE#ole_get_methods" do
Expand All @@ -14,4 +16,6 @@

end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'
require_relative 'shared/ole_method'

Expand All @@ -8,4 +10,6 @@

end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/ole_method_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'
require_relative 'shared/ole_method'

Expand All @@ -8,4 +10,6 @@

end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/ole_methods_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE#ole_methods" do
Expand All @@ -19,4 +21,6 @@
@dict.ole_methods.map { |m| m.name }.include?('AddRef').should be_true
end
end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/ole_obj_help_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require_relative "../../../spec_helper"

platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE#ole_obj_help" do
Expand All @@ -16,4 +18,6 @@
@dict.ole_obj_help.kind_of?(WIN32OLE_TYPE).should be_true
end
end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/ole_put_methods_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

describe "WIN32OLE#ole_put_methods" do
Expand All @@ -19,4 +21,6 @@
@dict.ole_put_methods.map { |m| m.name }.include?('Key').should be_true
end
end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole/setproperty_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'
require_relative 'shared/setproperty'

Expand All @@ -8,4 +10,6 @@

end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole_event/new_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'

guard -> { WIN32OLESpecs::MSXML_AVAILABLE } do
Expand Down Expand Up @@ -31,4 +33,6 @@
end
end
end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole_event/on_event_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'
guard -> { WIN32OLESpecs::MSXML_AVAILABLE } do

Expand Down Expand Up @@ -68,4 +70,6 @@ def handler_spec_alt(*args)
end
end
end
ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole_method/dispid_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require 'win32ole'

describe "WIN32OLE_METHOD#dispid" do
Expand All @@ -18,4 +20,6 @@

end

ensure
$VERBOSE = verbose
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'
guard -> { WIN32OLESpecs::SYSTEM_MONITOR_CONTROL_AVAILABLE } do

Expand All @@ -26,4 +28,6 @@
end
end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole_method/event_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require_relative '../fixtures/classes'
guard -> { WIN32OLESpecs::SYSTEM_MONITOR_CONTROL_AVAILABLE } do

Expand All @@ -20,4 +22,6 @@
end
end

ensure
$VERBOSE = verbose
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require 'win32ole'

describe "WIN32OLE_METHOD#helpcontext" do
Expand All @@ -24,4 +26,6 @@

end

ensure
$VERBOSE = verbose
end
4 changes: 4 additions & 0 deletions spec/ruby/library/win32ole/win32ole_method/helpfile_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "../../../spec_helper"
platform_is :windows do
verbose, $VERBOSE = $VERBOSE, nil

require 'win32ole'

describe "WIN32OLE_METHOD#helpfile" do
Expand All @@ -18,4 +20,6 @@

end

ensure
$VERBOSE = verbose
end
Loading

0 comments on commit 3e6f5ea

Please sign in to comment.