From 6180410cc4758aca5d1a2b459e25e9f9316609fb Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 30 Nov 2018 23:11:52 -0500 Subject: [PATCH] add spec for Cache validating JSON contents --- spec/rscons/cache_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/rscons/cache_spec.rb b/spec/rscons/cache_spec.rb index 4c15764..e1f5a86 100644 --- a/spec/rscons/cache_spec.rb +++ b/spec/rscons/cache_spec.rb @@ -79,5 +79,12 @@ module Rscons expect(build_from({}).send(:calculate_checksum, "fname")).to eq "the_checksum" end end + + describe "#validate_json_object" do + it "raises an error when an unexpected object is passed" do + cache = build_from({}) + expect {cache.__send__(:validate_json_object, :symbol)}.to raise_error /Unexpected cache value/ + end + end end end