Namespaces

 
  • (fake call-form => result)
Creates an expectation map that a particular call will be made. When it is made,
the result is to be returned. Either form may contain bound variables.
Example: (let [a 5] (fake (f a) => a))

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 midje/semi_sweet.clj:22 top

(defmacro fake 
  "Creates an expectation map that a particular call will be made. When it is made,
   the result is to be returned. Either form may contain bound variables. 
   Example: (let [a 5] (fake (f a) => a))"
  [call-form => result]
  `{:function (def ~(first call-form))
    :arg-matchers (map arg-matcher-maker [~@(rest call-form)])
    :call-text-for-failures (str '~call-form)
    :result-supplier (fn [] ~result)
    :count-atom (atom 0)
    :file-position (user-file-position)}
)
Vars in midje.semi-sweet/fake: defmacro first rest apply atom concat fn hash-map list map seq str vector
Used in 0 other vars

Comments top

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