Liking cljdoc? Tell your friends :D

spy.assert

clj

Assertion functions wrapping spy.core functions, providing assertions using clojure.test/is and messages to aid debugging when test expectations are not met.

Macros are used to ensure the clojure.test/is macro appears in the calling code, otherwise line numbers reported on failure will show as failures in the library and not the calling code.

Assertion functions wrapping spy.core functions,
providing assertions using clojure.test/is and messages
to aid debugging when test expectations are not met.

Macros are used to ensure the clojure.test/is macro
appears in the calling code, otherwise line numbers
reported on failure will show as failures in the
library and not the calling code.
cljs

Assertion functions wrapping spy.core functions, providing assertions using cljs.test/is and messages to aid debugging when test expectations are not met.

Differs from the Clojure version as macros are not used due to added complexity and the fact that cljs does not provide the line number on failure at present.

Assertion functions wrapping spy.core functions,
providing assertions using cljs.test/is and messages
to aid debugging when test expectations are not met.

Differs from the Clojure version as macros are not used
due to added complexity and the fact that cljs does not
provide the line number on failure at present.
raw docstring

spy.test

Implements the clojure.test/assert-expr multimethod for all spy predicates, allowing for rich error reporting without having to wrap clojure.test/is.

Example usage:

(def f (spy/spy))

(f "foo" "bar")

;; succeeds! (is (spy/called-with? f "foo" "bar")

;; fails with: ;; FAIL in () (form-init541289308750557841.clj:234) ;; expected: ("baz") ;; actual: [("foo" "bar")] (is (spy/called-with? f "baz"))

Implements the `clojure.test/assert-expr` multimethod for all spy predicates,
allowing for rich error reporting without having to wrap `clojure.test/is`.

Example usage:

(def f (spy/spy))

(f "foo" "bar")

;; succeeds!
(is (spy/called-with? f "foo" "bar")

;; fails with:
;; FAIL in () (form-init541289308750557841.clj:234)
;; expected: ("baz")
;;   actual: [("foo" "bar")]
(is (spy/called-with? f "baz"))
raw docstring

spy.test.cljs

No vars found in this namespace.

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

× close