Liking cljdoc? Tell your friends :D

mockazonica.core


mock-amazonica!clj

(mock-amazonica!
  &
  {:keys [redefs default-fn error-fn]
   :or {default-fn (fn [sym]
                       (fn default-mock
                           [& _]
                           (throw (Error. (str "amazonica function "
                                               sym
                                               " called but not mocked out")))))
        error-fn (fn [_ _])}})

Replace all symbols in amazonica with replacement functions in REDEFS, or with DEFAULT-FN. If given, DEFAULT-FN should be a function that accepts a symbol (the symbol of the function being called) and which returns a function that accepts (and possibly ignores) any number of arguments.

ERROR-FN can be set to a function that accepts the failed namespace and the throwable cause. The default ERROR-FN does nothing.

Returns a map of symbol->previous function.

Replace all symbols in amazonica with replacement functions in REDEFS, or with DEFAULT-FN.
If given, DEFAULT-FN should be a function that accepts a symbol (the symbol of the
function being called) and which returns a function that accepts (and possibly ignores)
any number of arguments.

ERROR-FN can be set to a function that accepts the failed namespace and the throwable
cause. The default ERROR-FN does nothing.

Returns a map of symbol->previous function.
sourceraw docstring

restore-functions!clj

(restore-functions! vals)

Restore all functions given in VALS (the return value from mock-amazonica!).

Restore all functions given in VALS (the return value from mock-amazonica!).
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close