test/download_strategies/curl_github_packages: fix bad const override
This commit is contained in:
parent
ef0d5fc978
commit
5e6d5f68ca
@ -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/,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user