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

m-isclj/smacro

(m-is & forms)
source

Mockcljs

source

mockclj/s≠

clj
(mock check! get-result)
cljs
(mock ??)
?? invalid arglists:
(quote ([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! Mock)
cljs
(mock-check! ??)
?? invalid arglists:
(quote ([Mock]))

Access check! field from a Mock record. See active.clojure.mock-monad/mock.

Access `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 Mock)
cljs
(mock-get-result ??)
?? invalid arglists:
(quote ([Mock]))

Access get-result field from a Mock record. See active.clojure.mock-monad/mock.

Access `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≠

clj
(mock? thing)
cljs
(mock? ??)
?? invalid arglists:
(quote ([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