(defn my-inc
([a b] (- (+ a (inc b)) b))
([a b c] (- (+ a (inc b)) b))
([a b c d & others] 1))
(defn strange-adder [a b]
(+ (my-inc a) b))
(fact
(strange-adder 1 2) => 300
(provided (my-inc 1) => 298))
You will get output like this
FAIL at (aaaaaa_the_basics.clj:292)
You faked #'my-inc with an argument count that doesn't match the function's defined arguements:
Provided 1 argument(s), where valid options are: 2, 3, or 4+ arguments
FAIL at (aaaaaa_the_basics.clj:292)
These calls were not made the right number of times:
(my-inc 1) [expected at least once, actually never called]
Addresses https://github.com/marick/Midje/issues/431 For a test like this:
You will get output like this