prepare for multi-test run

This commit is contained in:
jem 2019-05-21 18:41:15 +02:00
parent 149f1afd90
commit 22227ba979
2 changed files with 3 additions and 4 deletions

View file

@ -21,7 +21,7 @@
(s/defn test-with-data
[test-name :- s/Keyword]
(runner/run-test (runner/create-test-runner test-name)))
(runner/run-tests (runner/create-test-runner test-name)))
(defmacro defdatatest [name & body]
'(do

View file

@ -32,7 +32,7 @@
(defprotocol RunTest
"Protocol for data driven tests"
(name-prefix [dda-test])
(run-test [dda-test])
(run-tests [dda-test])
)
(s/defn dispatch-by-name :- s/Keyword
@ -60,7 +60,6 @@
(s/defn load-test-data
[file-prefix :- s/Str]
(let [file-path (str file-prefix ".edn")]
(println file-path)
(read-data
(io/resource file-path))))
@ -68,7 +67,7 @@
RunTest
(name-prefix [_]
(data-file-prefix (:name _)))
(run-test [_]
(run-tests [_]
(let [testdata (load-test-data (data-file-prefix (:name _)))
{:keys [input expectation]} testdata]
(data-test _ input expectation))))