Skip to content

Commit 229250a

Browse files
author
Christopher Frost
committed
Be more tolerant of existing env vars during tests
The download cache tests can fail if certain environment variables exist on the users machine. This commit makes those tests more tolerant of this. [#101130824]
1 parent 0cf8e42 commit 229250a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

spec/java_buildpack/util/cache/download_cache_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172

173173
context do
174174

175-
let(:environment) { { 'http_proxy' => 'http://proxy:9000' } }
175+
let(:environment) { { 'http_proxy' => 'http://proxy:9000', 'HTTP_PROXY' => nil } }
176176

177177
it 'uses http_proxy if specified' do
178178
stub_request(:get, uri)
@@ -189,7 +189,7 @@
189189

190190
context do
191191

192-
let(:environment) { { 'HTTP_PROXY' => 'http://proxy:9000' } }
192+
let(:environment) { { 'HTTP_PROXY' => 'http://proxy:9000', 'http_proxy' => nil } }
193193

194194
it 'uses HTTP_PROXY if specified' do
195195
stub_request(:get, uri)
@@ -206,7 +206,7 @@
206206

207207
context do
208208

209-
let(:environment) { { 'https_proxy' => 'http://proxy:9000' } }
209+
let(:environment) { { 'https_proxy' => 'http://proxy:9000', 'HTTPS_PROXY' => nil } }
210210

211211
it 'uses https_proxy if specified and URL is secure' do
212212
stub_request(:get, uri_secure)
@@ -223,7 +223,7 @@
223223

224224
context do
225225

226-
let(:environment) { { 'HTTPS_PROXY' => 'http://proxy:9000' } }
226+
let(:environment) { { 'HTTPS_PROXY' => 'http://proxy:9000', 'https_proxy' => nil } }
227227

228228
it 'uses HTTPS_PROXY if specified and URL is secure' do
229229
stub_request(:get, uri_secure)

0 commit comments

Comments
 (0)