Is there an equivalent of Midje facts form in clojure.test?

166 Views Asked by At

(facts ...) form in Midje, let's us group a bunch of (fact ..) forms and also have more (facts ..) form under it.

When writing corresponding test suite in clojure.test, what should be used to replace, (facts ...) ? Is there something else in clojure with similar semantics ?

1

There are 1 best solutions below

1
On BEST ANSWER

You can use testing to group your tests. Paraphrased example from the linked doc page:

(deftest arithmetic
  (testing "with positive integers"
    (is (= 4 (+ 2 2)))
    (is (= 7 (+ 3 4))))
  (testing "with negative integers"
    (is (= -4 (+ -2 -2)))
    (is (= -1 (+ 3 -4)))))