From 20ad5b2394001f6a3fe68b8105bade3afac01369 Mon Sep 17 00:00:00 2001 From: jem Date: Fri, 24 May 2019 13:31:12 +0200 Subject: [PATCH] improve error message --- main/src/data_test/file_loader.clj | 5 +++-- test/src/data_test/file_loader_test.clj | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main/src/data_test/file_loader.clj b/main/src/data_test/file_loader.clj index 7cd51ff..7986269 100644 --- a/main/src/data_test/file_loader.clj +++ b/main/src/data_test/file_loader.clj @@ -42,5 +42,6 @@ (try (read-data (io/resource file-path)) (catch IllegalArgumentException e - (throw (ex-info "unable to load test spec" {:cause e - :file-path file-prefix})))))) + (throw (ex-info (str "Could not find test spec on " file-path) + {:cause e + :file-path file-prefix})))))) diff --git a/test/src/data_test/file_loader_test.clj b/test/src/data_test/file_loader_test.clj index e1df273..ab90b5a 100644 --- a/test/src/data_test/file_loader_test.clj +++ b/test/src/data_test/file_loader_test.clj @@ -36,5 +36,5 @@ (sut/load-test-data (sut/data-file-prefix ::test-it))))) (deftest should-throw-exception - (is (thrown? Exception + (is (thrown? RuntimeException (sut/load-test-data (sut/data-file-prefix ::not-existing)))))