I want to write a function to factor out some common facts, like this
(defn check-odd-and-positive
[n]
(fact (str n " not odd") n => odd?)
(fact (str n " not positive") n => positive?))
(facts "about the answer"
(check-odd-and-positive 42))
But it doesn't result in "42 not odd" as the description of the fact. I know a similar effect could be achieved with tabular facts, but I want to be able to share such a fact among fact groups.
I found out, it's quite simple with metadata as of midje 1.6
(fact {:midje/description (str n "not odd")} n => odd?)