2017-02-12 21:37:46 +01:00
|
|
|
require "utils/bottles"
|
|
|
|
|
|
|
|
describe Utils::Bottles::Collector do
|
|
|
|
describe "#fetch_checksum_for" do
|
|
|
|
it "returns passed tags" do
|
2019-01-26 17:13:14 +00:00
|
|
|
subject[:yosemite] = "foo"
|
|
|
|
subject[:el_captain] = "bar"
|
|
|
|
expect(subject.fetch_checksum_for(:el_captain)).to eq(["bar", :el_captain])
|
2017-02-12 21:37:46 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
it "returns nil if empty" do
|
|
|
|
expect(subject.fetch_checksum_for(:foo)).to be nil
|
|
|
|
end
|
|
|
|
|
|
|
|
it "returns nil when there is no match" do
|
2019-01-26 17:13:14 +00:00
|
|
|
subject[:yosemite] = "foo"
|
2017-02-12 21:37:46 +01:00
|
|
|
expect(subject.fetch_checksum_for(:foo)).to be nil
|
|
|
|
end
|
|
|
|
|
2019-01-08 19:13:46 +00:00
|
|
|
it "uses older tags when needed", :needs_macos do
|
2019-01-26 17:13:14 +00:00
|
|
|
subject[:yosemite] = "foo"
|
|
|
|
expect(subject.fetch_checksum_for(:yosemite)).to eq(["foo", :yosemite])
|
|
|
|
expect(subject.fetch_checksum_for(:mavericks)).to be nil
|
2017-02-12 21:37:46 +01:00
|
|
|
end
|
2017-02-12 21:37:46 +01:00
|
|
|
end
|
|
|
|
end
|