Skip to content

Commit dcbb6b7

Browse files
committed
fix: add spec
1 parent 120b9e3 commit dcbb6b7

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
entitlements-app (1.2.0)
4+
entitlements-app (1.2.1)
55
concurrent-ruby (~> 1.3, >= 1.3.1)
66
faraday (~> 2.0)
77
logger (~> 1.6)

spec/unit/entitlements/data/groups/cached_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@
1717
end
1818
end
1919

20+
context "with a file that fails to parse" do
21+
let(:dir) { fixture("predictive-state/failing-cache") }
22+
23+
it "raises with a custom message" do
24+
expect(logger).to receive(:debug).with("Loading predictive update caches from #{dir}")
25+
26+
expect do
27+
described_class.load_caches(dir)
28+
end.to raise_error(RuntimeError, /Failed to load predictive state cache file/)
29+
end
30+
end
31+
2032
context "with valid predictive state directory" do
2133
let(:dir) { fixture("predictive-state/cache1") }
2234

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
metadata_is_missing_a_value

0 commit comments

Comments
 (0)