• (calls val)
  • (calls val expectation-hash)
Creates or associates to an existing expectation hash the :calls key with a
function that will be called with the given arguments. The return value from
this function will be returned returned by the expected function. If both this
and returns are specified, the return value of "calls" will have precedence.
Usage:
(calls some-fn expectation-hash?)

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:216 top

(defn calls
  "Creates or associates to an existing expectation hash the :calls key with a
function that will be called with the given arguments. The return value from
this function will be returned returned by the expected function. If both this
and returns are specified, the return value of \"calls\" will have precedence.
Usage:
(calls some-fn expectation-hash?)"

  ([val] (calls val {}))
  ([val expectation-hash] (assoc expectation-hash :calls val)))
Vars in clojure.contrib.mock/calls: assoc defn val
Used in 0 other vars

Comments top

No comments for calls. Log in to add a comment.