• (make-count-checker pred pred-form)
creates the count checker that is invoked at the end of an expectation, after
the code under test has all been executed. The function returned takes the
name of the associated dependency and the invocation count as arguments.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/mock.clj:131 top

(defn make-count-checker
  "creates the count checker that is invoked at the end of an expectation, after
the code under test has all been executed. The function returned takes the
name of the associated dependency and the invocation count as arguments."
  [pred pred-form]
  (let [pred-fn (if (integer? pred) #(= pred %) pred)]
    (fn [fn-name v] (if (pred-fn v) true
                      (incorrect-invocation-count fn-name pred-form v)))))
Vars in clojure.contrib.mock.test-adapter/make-count-checker: defn fn let
Used in 0 other vars

Comments top

No comments for make-count-checker. Log in to add a comment.