Skip to content

Commit 732f1b7

Browse files
committed
Fix leaking globals ($VERBOSE and $DEBUG) in Windows' specs
This reverts commit 3caf9ce "Suppress WIN32OLE deprecation warnings for the time being" that leads to the following error: ``` An exception occurred during: WIN32OLE#_getproperty gets value D:/a/spec/spec/library/win32ole/win32ole/_getproperty_spec.rb:12 WIN32OLE#_getproperty gets value ERROR LeakError: Globals changed: {:verbose=>false, :debug=>false} to {:verbose=>nil, :debug=>false} D:/a/spec/spec/library/win32ole/win32ole/_getproperty_spec.rb:7:in `block in <top (required)>' D:/a/spec/spec/library/win32ole/win32ole/_getproperty_spec.rb:2:in `<top (required)>' ```
1 parent b27491f commit 732f1b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+0
-299
lines changed

library/win32ole/fixtures/classes.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
require 'win32ole'
22

33
module WIN32OLESpecs
4-
WIN32OLERuntimeError ||= WIN32OLE::RuntimeError
5-
WIN32OLE_TYPELIB ||= WIN32OLE::TypeLib
6-
74
MSXML_AVAILABLE = WIN32OLE_TYPELIB.typelibs.any? { |t| t.name.start_with?('Microsoft XML') }
85
SYSTEM_MONITOR_CONTROL_AVAILABLE = WIN32OLE_TYPELIB.typelibs.any? { |t| t.name.start_with?('System Monitor Control') }
96

library/win32ole/win32ole/_getproperty_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative "../../../spec_helper"
22
platform_is :windows do
3-
verbose, $VERBOSE = $VERBOSE, nil
4-
53
require_relative '../fixtures/classes'
64

75
describe "WIN32OLE#_getproperty" do
@@ -14,6 +12,4 @@
1412
@dict._getproperty(0, ['key'], [WIN32OLE::VARIANT::VT_BSTR]).should == 'value'
1513
end
1614
end
17-
ensure
18-
$VERBOSE = verbose
1915
end

library/win32ole/win32ole/_invoke_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative "../../../spec_helper"
22
platform_is :windows do
3-
verbose, $VERBOSE = $VERBOSE, nil
4-
53
require_relative '../fixtures/classes'
64

75
describe "WIN32OLE#_invoke" do
@@ -21,6 +19,4 @@
2119

2220
end
2321

24-
ensure
25-
$VERBOSE = verbose
2622
end
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative "../../../spec_helper"
22
platform_is :windows do
3-
verbose, $VERBOSE = $VERBOSE, nil
4-
53
require_relative '../fixtures/classes'
64

75
describe "WIN32OLE.codepage=" do
@@ -13,6 +11,4 @@
1311
end
1412
end
1513

16-
ensure
17-
$VERBOSE = verbose
1814
end

library/win32ole/win32ole/connect_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative "../../../spec_helper"
22
platform_is :windows do
3-
verbose, $VERBOSE = $VERBOSE, nil
4-
53
require_relative '../fixtures/classes'
64

75
describe "WIN32OLE.connect" do
@@ -15,6 +13,4 @@
1513
end
1614

1715
end
18-
ensure
19-
$VERBOSE = verbose
2016
end

library/win32ole/win32ole/const_load_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative "../../../spec_helper"
22
platform_is :windows do
3-
verbose, $VERBOSE = $VERBOSE, nil
4-
53
require_relative '../fixtures/classes'
64

75
describe "WIN32OLE.const_load when passed Shell.Application OLE object" do
@@ -32,6 +30,4 @@ module WIN32OLE_RUBYSPEC; end
3230
end
3331
end
3432

35-
ensure
36-
$VERBOSE = verbose
3733
end

library/win32ole/win32ole/constants_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative "../../../spec_helper"
22
platform_is :windows do
3-
verbose, $VERBOSE = $VERBOSE, nil
4-
53
require_relative '../fixtures/classes'
64

75
describe "WIN32OLE class" do
@@ -42,6 +40,4 @@
4240
end
4341
end
4442

45-
ensure
46-
$VERBOSE = verbose
4743
end
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
require_relative "../../../spec_helper"
22
platform_is :windows do
3-
verbose, $VERBOSE = $VERBOSE, nil
4-
53
require_relative '../fixtures/classes'
64

75
describe "WIN32OLE.create_guid" do
86
it "generates guid with valid format" do
97
WIN32OLE.create_guid.should =~ /^\{[A-Z0-9]{8}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{12}/
108
end
119
end
12-
ensure
13-
$VERBOSE = verbose
1410
end

library/win32ole/win32ole/invoke_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative "../../../spec_helper"
22
platform_is :windows do
3-
verbose, $VERBOSE = $VERBOSE, nil
4-
53
require_relative '../fixtures/classes'
64

75
describe "WIN32OLE#invoke" do
@@ -14,6 +12,4 @@
1412
@dict.invoke('Item', 'key').should == 'value'
1513
end
1614
end
17-
ensure
18-
$VERBOSE = verbose
1915
end

library/win32ole/win32ole/locale_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative "../../../spec_helper"
22
platform_is :windows do
3-
verbose, $VERBOSE = $VERBOSE, nil
4-
53
require_relative '../fixtures/classes'
64

75
describe "WIN32OLE.locale" do
@@ -29,6 +27,4 @@
2927
end
3028
end
3129
end
32-
ensure
33-
$VERBOSE = verbose
3430
end

0 commit comments

Comments
 (0)