Liking cljdoc? Tell your friends :D

bond.james


callsclj

(calls f)

Takes one arg, a fn that has previously been spied. Returns a seq of maps, one per call. Each map contains the keys :args and :return or :throw. If the fn has not been spied, throws an exception.

Takes one arg, a fn that has previously been spied. Returns a seq
of maps, one per call. Each map contains the keys :args and :return
or :throw. If the fn has not been spied, throws an exception.
sourceraw docstring

ns->fn-symbolsclj

(ns->fn-symbols ns)

A utility function to get a sequence of fully-qualified symbols for all the functions in a namespace.

A utility function to get a sequence of fully-qualified symbols for all the
functions in a namespace.
sourceraw docstring

spyclj

(spy f)

wrap f, returning a new fn that keeps track of its call count and arguments.

wrap f, returning a new fn that keeps track of its call count and arguments.
sourceraw docstring

stub!clj

(stub! v replacement)
source

with-spycljmacro

(with-spy vs & body)

Takes a vector of fn vars (vars that resolve to fns). Modifies the fn to track call counts, but does not change the fn's behavior.

Takes a vector of fn vars (vars that resolve to fns). Modifies the
fn to track call counts, but does not change the fn's behavior.
sourceraw docstring

with-spy-nscljmacro

(with-spy-ns namespaces & body)

Like with-spy but takes a vector of namespaces. Spies on every function in the namespace.

Like with-spy but takes a vector of namespaces. Spies on every function in
the namespace.
sourceraw docstring

with-stubcljmacro

(with-stub vs & body)

Takes a vector of fn vars and/or [fn replacement] vectors.

Replaces each fn with its replacement. If a replacement is not specified for a fn it is replaced with one that takes any number of args and returns nil. Also spies the stubbed-fn.

Takes a vector of fn vars and/or [fn replacement] vectors.

Replaces each fn with its replacement. If a replacement is not specified for
a fn it is replaced with one that takes any number of args and returns nil.
Also spies the stubbed-fn.
sourceraw docstring

with-stub!cljmacro

(with-stub! vs & body)

Like with-stub, but throws an exception upon arity mismatch.

Like with-stub, but throws an exception upon arity mismatch.
sourceraw docstring

with-stub-nscljmacro

(with-stub-ns namespaces & body)

Takes a vector of namespaces and/or [namespace replacement] vectors.

Replaces every fn in each namespace with its replacement. If a replacement is not specified for a namespace every fn in that namespace is replaced with (constantly nil). All replaced functions are also spied.

Takes a vector of namespaces and/or [namespace replacement] vectors.

Replaces every fn in each namespace with its replacement. If a replacement is
not specified for a namespace every fn in that namespace is replaced with
(constantly nil). All replaced functions are also spied.
sourceraw docstring

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

× close