Liking cljdoc? Tell your friends :D

com.siili.memocks


all-argsclj

(all-args m)

Returns all recorded arguments.

Returns all recorded arguments.
sourceraw docstring

invoked-with?clj

(invoked-with? m & expected-args)

Checks if mock was invoked with given args

Checks if mock was invoked with given args
sourceraw docstring

invoked?clj

(invoked? m)

Checks if mock was ever invoked.

Checks if mock was ever invoked.
sourceraw docstring

last-argsclj

(last-args m)

Returns last recorder arguments.

Returns last recorder arguments.
sourceraw docstring

mockclj

(mock)
(mock f-or-res)

Creates mock function that accepts variable number of arguments and will return nil or given value and record all arguments passed to the function. If you specify function as a value, it will be executed with vector of all invokations as an argument.

Creates mock function that accepts variable number of arguments
and will return nil or given value and record all arguments passed
to the function. If you specify function as a value, it will be
executed with vector of all invokations as an argument.
sourceraw docstring

not-invoked?clj

(not-invoked? m)

Checks if mock was never invoked.

Checks if mock was never invoked.
sourceraw docstring

with-mockscljmacro

(with-mocks mocks & body)

This macro is a syntactic sugar for mocking specified symbols.

(with-mocks [somens/somefn x] (println (somens/somefn 10)))

will be replaced with

(with-redefs [somens/somefn (siili.memocks/mock x)] (println (somens/somefn 10)))

This macro is a syntactic sugar for mocking specified symbols.

(with-mocks [somens/somefn x]
  (println (somens/somefn 10)))

will be replaced with

(with-redefs [somens/somefn (siili.memocks/mock x)]
  (println (somens/somefn 10))) 
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close