specific icon indicating copy to clipboard operation
specific copied to clipboard

Using (calls) to count the calls to a double is misleading when it's not a double

Open benrady opened this issue 9 years ago • 0 comments

specific.core/calls returns a vector of call tuples, except when the function being checked is not a test double. In that case, it returns a map with an error message. However, this means that you can't rely on calls to have the right count, in order to write tests like this:

(is (= 3 (calls my-mock)))

Instead, specific.core/calls should either raise an exception or report a clojure.test error when it is called with a non-double function.

benrady avatar Dec 12 '16 22:12 benrady