You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope Midje's syntax is concise enough that there's no need for a tabular notation like clojure.test's are. For example, here's the use of are from the clojure.test API:
(are [x y] (= x y)
2 (+11)
4 (*22))
Here's the same sort of thing in Midje:
(facts"about arithmetic identities"
(let [n 33] ; represents an arbitrary integer
(+00) => 0
(+ n 0) => n
(*11) => 1
(* n 1) => n))
Here's another example:
(facts"about my fast prime finder"
(let [n 29] ; represents an arbitrarily chosen prime (other than 2)
(nth (primes) 0) => 2
(nth (primes) 1) => 3
(nth (primes) n) => odd?
(nth (primes) n) => prime?))