Merge pull request #13322 from Bo98/test-const-fix

test/download_strategies/curl_github_packages: fix bad const override
This commit is contained in:
Bo Anderson 2022-05-24 23:30:17 +01:00 committed by GitHub
commit 371f1810da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,9 +10,11 @@ describe CurlGitHubPackagesDownloadStrategy do
let(:url) { "https://#{GitHubPackages::URL_DOMAIN}/v2/homebrew/core/spec_test/manifests/1.2.3" }
let(:version) { "1.2.3" }
let(:specs) { {} }
let(:authorization) { nil }
describe "#fetch" do
before do
stub_const("HOMEBREW_GITHUB_PACKAGES_AUTH", authorization) if authorization.present?
strategy.temporary_path.dirname.mkpath
FileUtils.touch strategy.temporary_path
end
@ -31,10 +33,6 @@ describe CurlGitHubPackagesDownloadStrategy do
context "with Github Packages authentication defined" do
let(:authorization) { "Bearer dead-beef-cafe" }
before do
HOMEBREW_GITHUB_PACKAGES_AUTH = authorization.freeze
end
it "calls curl with the provided header value" do
expect(strategy).to receive(:system_command).with(
/curl/,