(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.
(local-calls f)
Same as calls, but for those symbols which were locally spied or stubbed.
Same as calls, but for those symbols which were locally spied or stubbed.
(local-spy v f)
Same as spy, but does it on the current clojure thread
Same as spy, but does it on the current clojure thread
(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.
(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.
(with-local-spy vs & body)
Same as with-spy but spies only on the current clojure thread.
Same as with-spy but spies only on the current clojure thread.
(with-local-spy-ns namespaces & body)
Same as with-spy but does it on the current clojure thread.
Same as with-spy but does it on the current clojure thread.
(with-local-stub vs & body)
Same as with-stub but only stubs it on the local clojure thread.
Same as with-stub but only stubs it on the local clojure thread.
(with-local-stub! vs & body)
Like with-stub!, but only works for thread-locally
Like with-stub!, but only works for thread-locally
(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.
(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.
(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.
(with-stub! vs & body)
Like with-stub, but throws an exception upon arity mismatch.
Like with-stub, but throws an exception upon arity mismatch.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close