Liking cljdoc? Tell your friends :D

active.clojure.mock-monad

Mock monadic programs

Mock monadic programs
raw docstring

check-mocks-emptyclj/s

source

is-mocked-stateclj/s

(is-mocked-state expectation mock-result-state)

Takes an expectation and the monad-command-config-state after running a mock. Applies is to the = of both, dissocing the ::mocks from the returned state.

Takes an `expectation` and the `monad-command-config-state` after running a mock.
Applies `is` to the `=` of both, dissocing the ::mocks from the returned state.
sourceraw docstring

mockclj/s

(mock check! get-result)

Construct a Mock record.

check!: access via active.clojure.mock-monad/mock-check! get-result: access via active.clojure.mock-monad/mock-get-result

Construct a `Mock` record.

`check!`: access via [[active.clojure.mock-monad/mock-check!]]
`get-result`: access via [[active.clojure.mock-monad/mock-get-result]]
sourceraw docstring

mock-check!clj/s≠

clj
(mock-check! rec__3650__auto__)
(mock-check! data__3651__auto__ v__3652__auto__)
cljs
(mock-check! rec__3306__auto__)
(mock-check! data__3307__auto__ v__3308__auto__)

Lens for the check! field from a [[Mock]] record. See active.clojure.mock-monad/mock.

Lens for the `check!` field from a [[Mock]] record. See [[active.clojure.mock-monad/mock]].
sourceraw docstring

mock-commandsclj/s

(mock-commands mocks)
source

mock-effectclj/s

(mock-effect m-expected m-replacement)

If (= m-expected m) returns true for a command m, then execute m-replacement instead.

If `(= m-expected m)` returns true for a command `m`, then execute `m-replacement` instead.
sourceraw docstring

mock-execute-monadclj/s

(mock-execute-monad mocks m)
(mock-execute-monad command-config mocks m)
source

mock-get-resultclj/s≠

clj
(mock-get-result rec__3650__auto__)
(mock-get-result data__3651__auto__ v__3652__auto__)
cljs
(mock-get-result rec__3306__auto__)
(mock-get-result data__3307__auto__ v__3308__auto__)

Lens for the get-result field from a [[Mock]] record. See active.clojure.mock-monad/mock.

Lens for the `get-result` field from a [[Mock]] record. See [[active.clojure.mock-monad/mock]].
sourceraw docstring

mock-ignoreclj/s

source

mock-resultclj/s

(mock-result m-expected value)

If (= m-expected m) returns true for a command m, then return value instead.

If `(= m-expected m)` returns true for a command `m`, then return `value` instead.
sourceraw docstring

mock-run-monadclj/s

(mock-run-monad mocks m)
(mock-run-monad command-config mocks m)

Run m under the given monad command configs, and the given mocked commands, returning the result of m. mocks should be a sequence, whose values can be created by the mock, mock-result or mock-effect and other functions above, and are expected to appear in that order while executing m.

Run m under the given monad command configs, and the given mocked commands, returning the result of m.
 `mocks` should be a sequence, whose values can be created by the
`mock`, `mock-result` or `mock-effect` and other functions above, and are
expected to appear in that order while executing `m`.
sourceraw docstring

mock?clj/s

(mock? thing)

Is object a Mock record? See active.clojure.mock-monad/mock.

Is object a `Mock` record? See [[active.clojure.mock-monad/mock]].
sourceraw docstring

with-mock-run-monadclj/s

(with-mock-run-monad command-config f)

Immediately calls f with a function of two arguments, mocks and m, which can be repeatedly called to evaluate monadic commands m, with mocked commands like in test-run-monad. The monad state is preserved from call to call. Returns [result state].

Immediately calls f with a function of two arguments, `mocks` and
`m`, which can be repeatedly called to evaluate monadic commands
`m`, with mocked commands like in `test-run-monad`. The monad state
is preserved from call to call.  Returns `[result state]`.
sourceraw docstring

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

× close