(ex-symbol env)
(reduce-are init & pairs)
Like clojure.test/are
, but reduces over an initial value.
The reducing value is expected to be on the left side, and on the right side there is one or many functions to apply. The reducing value is carried over to next pair.
init
is either just a single initial value, or a vector with
[initial-value left-f right-f], where left-f
and right-f
are
functions that are applied to left/right side of each pair.
Examples:
` (reduce-are 1 2 inc 3 inc)
(reduce-are [1 parse-long] "2" inc "13" [inc #(+ 10 %)] "12" dec)
(reduce-are [1 identity str] 2 inc 13 [inc #(+ 10 %)] 12 dec)) `
Like `clojure.test/are`, but reduces over an initial value. The reducing value is expected to be on the left side, and on the right side there is one or many functions to apply. The reducing value is carried over to next pair. `init` is either just a single initial value, or a vector with [initial-value left-f right-f], where `left-f` and `right-f` are functions that are applied to left/right side of each pair. Examples: ` (reduce-are 1 2 inc 3 inc) (reduce-are [1 parse-long] "2" inc "13" [inc #(+ 10 %)] "12" dec) (reduce-are [1 identity str] 2 inc 13 [inc #(+ 10 %)] 12 dec)) `
(should-be expected actual)
(thrown-ex-data body)
(thrown-ex-data ks body)
Catches an exception in body
and extracts the ex-data, to make it easy to
test exceptional code. If ks
is given, these keys are extracted from the
ex-data map.
If an exception is not thrown, it returns
{:expected-exception :was-not-thrown}
Catches an exception in `body` and extracts the ex-data, to make it easy to test exceptional code. If `ks` is given, these keys are extracted from the ex-data map. If an exception is not thrown, it returns `{:expected-exception :was-not-thrown}`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close