File tree Expand file tree Collapse file tree 2 files changed +31
-39
lines changed Expand file tree Collapse file tree 2 files changed +31
-39
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ require "utils/bottles"
2+
3+ describe Utils ::Bottles ::Collector do
4+ describe "#fetch_checksum_for" do
5+ it "returns passed tags" do
6+ subject [ :lion ] = "foo"
7+ subject [ :mountain_lion ] = "bar"
8+ expect ( subject . fetch_checksum_for ( :mountain_lion ) ) . to eq ( [ "bar" , :mountain_lion ] )
9+ end
10+
11+ it "returns nil if empty" do
12+ expect ( subject . fetch_checksum_for ( :foo ) ) . to be nil
13+ end
14+
15+ it "returns nil when there is no match" do
16+ subject [ :lion ] = "foo"
17+ expect ( subject . fetch_checksum_for ( :foo ) ) . to be nil
18+ end
19+
20+ it "returns nil when there is no match and later tag is present" do
21+ subject [ :lion_or_later ] = "foo"
22+ expect ( subject . fetch_checksum_for ( :foo ) ) . to be nil
23+ end
24+
25+ it "prefers exact matches" do
26+ subject [ :lion_or_later ] = "foo"
27+ subject [ :mountain_lion ] = "bar"
28+ expect ( subject . fetch_checksum_for ( :mountain_lion ) ) . to eq ( [ "bar" , :mountain_lion ] )
29+ end
30+ end
31+ end
You can’t perform that action at this time.
0 commit comments