I'd like to use Midje for intergration tests.
(I like it's error-reporting and slick API VS what standard clojure.test offers).
I am looking for a way to stop execution of facts in a "facts" block,
if any of (preceeding) facts within that "facts" block fails or there was an exception.
Q: How do I do this in Midje?
Here is a typical scenario:
(facts "...some API tests"
; ensure that there are no users
(for [id [1 2 3 4 5]] (api/get-user id)) => [nil nil nil nil nil]
; ^^^ if the above check fails, there is no reason to continue with the rest
; the rest of checks in this "facts" block should not be executed
; create 5 users
(for [id [1 2 3 4 5]] (api/create-user id))
; ^^^ same thing, if the above check fails due to an exception,
; the rest of checkers in this "facts" block should not be executed
; (but the next "facts" block outside should
; load 5 users
(map :id (for [id [1 2 3 4 5]] (api/get-user id))) => [1 2 3 4 5] )
Currently, the code above will run all "=>" checks, regardless if a preceding check fails (I'd like to skip the rest of checks within this "facts" block).
Also, if there is an exception, the the whole test procedure stops (I'd like it to continue with the next "facts" block instead).