Liking cljdoc? Tell your friends :D

uk.axvr.dynamock

The core of Dynamock.

The core of Dynamock.
raw docstring

*stubs*clj/s

Dynamock stub registry. (Avoid accessing and manipulating this directly.)

Dynamock stub registry.  (Avoid accessing and manipulating this directly.)
sourceraw docstring

stub!clj/smacro

(stub! f stub)

Register a stub in the current stub-scope for a given mocked function (f).

Register a stub in the current stub-scope for a given mocked function (f).
sourceraw docstring

with-mockclj/smacro

(with-mock f mock & body)

Mock invocations of function (f) in the body. The function will be replaced with the result of the given mock-builder function (mock).

The mock-builder will be passed 2 parameters:

  1. the original function, which the mock can optionally use.
  2. a function, taking no parameters which when called returns a list of registered stubs for the mock.

After invocation, the mock-builder should return a function (the mock) with a compatible parameter list as the function being mocked.

Automatically defines a new stub-scope for the body.

Mock invocations of function (f) in the body.  The function will be replaced
with the result of the given mock-builder function (mock).

The mock-builder will be passed 2 parameters:

  1. the original function, which the mock can optionally use.
  2. a function, taking no parameters which when called returns a list of
     registered stubs for the mock.

After invocation, the mock-builder should return a function (the mock) with
a compatible parameter list as the function being mocked.

Automatically defines a new stub-scope for the body.
sourceraw docstring

with-stubclj/smacro

(with-stub f stub & body)

Register stub for a mocked function (f) that will be available in body. Automatically places the stub in a new stub-scope.

Register stub for a mocked function (f) that will be available in body.
Automatically places the stub in a new stub-scope.
sourceraw docstring

with-stub-scopeclj/smacro

(with-stub-scope & body)

Scope stubs registered in the body with stub! to a new dynamic scope.

Scope stubs registered in the body with `stub!` to a new dynamic scope.
sourceraw docstring

with-stubsclj/smacro

(with-stubs f stubs & body)

Same as with-stub but registers multiple stubs at once when grouped together in a vector.

Same as `with-stub` but registers multiple stubs at once when grouped
together in a vector.
sourceraw docstring

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

× close