Add covering test for headers

This commit is contained in:
Chris Tompkinson 2020-03-10 10:47:18 +00:00
parent 38da4dcac0
commit 160b2c40d0

View File

@ -241,6 +241,21 @@ describe CurlDownloadStrategy do
subject.fetch
end
end
context "with headers set" do
alias_matcher :a_string_matching, :match
let(:specs) { { headers: ["foo", "bar"]} }
it "adds the appropriate curl args" do
expect(subject).to receive(:system_command!) { |*, args:, **|
expect(args.each_cons(2).to_a).to include(["--header", "foo"])
expect(args.each_cons(2).to_a).to include(["--header", "bar"])
}
subject.fetch
end
end
end
describe "#cached_location" do