Skip to content

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

@benrady

Description

@benrady

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions