(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)))) ```
(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)))) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close