improve file-loaders exception readability

pull/1/head
jem 5 years ago
parent f0a30e0c20
commit dfb35e06f0

@ -39,4 +39,8 @@
(s/defn load-test-data
[file-prefix :- s/Str]
(let [file-path (str file-prefix ".edn")]
(read-data (io/resource file-path))))
(try
(read-data (io/resource file-path))
(catch IllegalArgumentException e
(throw (ex-info "unable to load test spec" {:cause e
:file-path file-prefix}))))))

@ -35,3 +35,6 @@
(is (= {:test "data"}
(sut/load-test-data (sut/data-file-prefix ::test-it)))))
(deftest should-throw-exception
(is (thrown? Exception
(sut/load-test-data (sut/data-file-prefix ::not-existing)))))

Loading…
Cancel
Save