add file as testing context

This commit is contained in:
jem 2019-05-28 18:59:52 +02:00
parent 4240c2744b
commit 15637254ae

View file

@ -33,7 +33,10 @@
:test `(fn [] :test `(fn []
(doseq [data-spec# (fl/load-data-test-specs ~namespaced-test-key#)] (doseq [data-spec# (fl/load-data-test-specs ~namespaced-test-key#)]
(let [~(symbol (first bindings)) (:input data-spec#) (let [~(symbol (first bindings)) (:input data-spec#)
~(symbol (second bindings)) (:expectation data-spec#)] ~(symbol (second bindings)) (:expectation data-spec#)
~@body))) data-spec-file# (:data-spec-file data-spec#)]
(binding [ct/*testing-contexts*
(conj ct/*testing-contexts* data-spec-file#)]
~@body))))
:data-spec-key namespaced-test-key#) :data-spec-key namespaced-test-key#)
(fn [] (ct/test-var (var ~n))))))) (fn [] (ct/test-var (var ~n)))))))