Merge pull request #3074 from CamJN/master
Fix curl --user flag being broken in dc5a2c17
This commit is contained in:
commit
9d6ae89ea3
@ -381,7 +381,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
||||
# Curl options to be always passed to curl,
|
||||
# with raw head calls (`curl --head`) or with actual `fetch`.
|
||||
def _curl_opts
|
||||
return ["--user" << meta.fetch(:user)] if meta.key?(:user)
|
||||
return ["--user", meta.fetch(:user)] if meta.key?(:user)
|
||||
[]
|
||||
end
|
||||
|
||||
|
||||
@ -200,6 +200,17 @@ describe GitDownloadStrategy do
|
||||
end
|
||||
end
|
||||
|
||||
describe CurlDownloadStrategy do
|
||||
subject { described_class.new(name, resource) }
|
||||
let(:name) { "foo" }
|
||||
let(:url) { "http://example.com/foo.tar.gz" }
|
||||
let(:resource) { double(Resource, url: url, mirrors: [], specs: { user: "download:123456" }, version: nil) }
|
||||
|
||||
it "parses the opts and sets the corresponding args" do
|
||||
expect(subject.send(:_curl_opts)).to eq(["--user", "download:123456"])
|
||||
end
|
||||
end
|
||||
|
||||
describe DownloadStrategyDetector do
|
||||
describe "::detect" do
|
||||
subject { described_class.detect(url) }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user