The following matchers are available by default in easy-assert:
:is-equal-toChecks if the actual value is equal to the expected value.
(assert-that 5 :is-equal-to 5)
:is-not-equal-toChecks if the actual value is not equal to the expected value.
(assert-that 5 :is-not-equal-to 3)
:isAlias for :is-equal-to.
(assert-that 5 :is 5)
:is-notAlias for :is-not-equal-to.
(assert-that 5 :is-not 3)
:starts-withChecks if the actual string starts with the expected string.
(assert-that "hello" :starts-with "he")
:has-sizeChecks if the collection has the expected size.
(assert-that [1 2 3] :has-size 3)
:includesChecks if the actual collection includes all the expected elements.
(assert-that [1 2 3] :includes [2 3])
:does-not-includeChecks if the actual collection does not include any of the expected elements.
(assert-that [1 2 3] :does-not-include [4 5])
:exception-has-messageChecks if the exception has the expected message.
(assert-that-thrown-by #(throw (Exception. "error"))
:exception-has-message "error")
:exception-caused-byChecks if the exception was caused by the expected cause.
(assert-that-thrown-by #(throw (Exception. "error" (Exception. "cause")))
:exception-caused-by (Exception. "cause"))
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |