Liking cljdoc? Tell your friends :D
Clojure only.

me.pmatiello.mockfn.plain


providingcljmacro

(providing bindings & body)

Replaces functions with mocks. These mocks return preconfigured values when called with the expected arguments.

(providing
  [(fn-name &args) return-value
   ...]
  test-body)

Example:

(providing
  [(one-fn) :result]
  (is (= :result (one-fn))))
Replaces functions with mocks. These mocks return preconfigured values when
called with the expected arguments.

```
(providing
  [(fn-name &args) return-value
   ...]
  test-body)
```

Example:
```
(providing
  [(one-fn) :result]
  (is (= :result (one-fn))))
```
sourceraw docstring

verifyingcljmacro

(verifying bindings & body)

Replaces functions with mocks. Verifies that a calls where performed the expected number of times.

(verifying
  [(fn-name &args) return-value call-count-matcher
   ...]
  test-body)

Example:

(verifying
  [(one-fn :argument) :result (exactly 1)]
  (is (= :result (one-fn :argument))))
Replaces functions with mocks. Verifies that a calls where performed the
expected number of times.

```
(verifying
  [(fn-name &args) return-value call-count-matcher
   ...]
  test-body)
```

Example:
```
(verifying
  [(one-fn :argument) :result (exactly 1)]
  (is (= :result (one-fn :argument))))
```
sourceraw docstring

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

× close