Integration of fhofherr/stub-fn
into clojure.test
.
Re-exports the [[core/stub-fn]] macro.
It extends clojure.test/assert-expr
to provide the invoked?
assertion.
The invoked?
assertions accepts the same arguments as
[[core/verify-invocations]].
In order to use fhofherr/stub-fn
together with clojure.test
something
like the following is enough:
(ns my-test-ns
(:require [clojure.test :refer :all]
[fhofherr.stub-fn.clojure.test :refer [stub-fn]]))
(deftest some-test
(let [stubbed-fn (stub-fn stubbed-fn [])]
(stubbed-fn)
(is (invoked? stubbed-fn :times 1))))
Integration of `fhofherr/stub-fn` into `clojure.test`. Re-exports the [[core/stub-fn]] macro. It extends `clojure.test/assert-expr` to provide the `invoked?` assertion. The `invoked?` assertions accepts the same arguments as [[core/verify-invocations]]. In order to use `fhofherr/stub-fn` together with `clojure.test` something like the following is enough: ```clojure (ns my-test-ns (:require [clojure.test :refer :all] [fhofherr.stub-fn.clojure.test :refer [stub-fn]])) (deftest some-test (let [stubbed-fn (stub-fn stubbed-fn [])] (stubbed-fn) (is (invoked? stubbed-fn :times 1)))) ```
(stub-fn fn-name fn-args & fn-body)
Convenience re-export of [[core/stub-fn]].
Convenience re-export of [[core/stub-fn]].
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close