test/download_strategies/curl_github_packages: fix bad const override

This commit is contained in:
Bo Anderson 2022-05-24 22:50:22 +01:00
parent ef0d5fc978
commit 5e6d5f68ca
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

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