Liking cljdoc? Tell your friends :D

expectations.clojure.test

This namespace provides compatibility with clojure.test and related tooling.

This namespace should be used standalone, without requiring the 'expectations' namespace -- this provides a translation layer from Expectations syntax down to clojure.test functionality.

We do not support ClojureScript in clojure.test mode, sorry.

This namespace provides compatibility with clojure.test and related tooling.

This namespace should be used standalone, without requiring the 'expectations'
namespace -- this provides a translation layer from Expectations syntax down
to clojure.test functionality.

We do not support ClojureScript in clojure.test mode, sorry.
raw docstring

?cljmacro

(? form)

Wrapper for forms that might throw an exception so exception class names can be used as predicates. This is only needed for more-> so that you can thread exceptions into code that can parse information out of them, to be used with various expect predicates.

Wrapper for forms that might throw an exception so exception class names
can be used as predicates. This is only needed for more-> so that you can
thread exceptions into code that can parse information out of them, to be
used with various expect predicates.
sourceraw docstring

all-reportclj

(all-report store)

Given an atom in which to accumulate results, return a function that can be used in place of clojure.test/do-report, which simply remembers all the reported results.

This is used to support the semantics of expect/in.

Given an atom in which to accumulate results, return a function that
can be used in place of clojure.test/do-report, which simply remembers
all the reported results.

This is used to support the semantics of expect/in.
sourceraw docstring

approximatelyclj

(approximately v)
(approximately v d)

Given a value and an optional delta (default 0.001), return a predicate that expects its argument to be within that delta of the given value.

Given a value and an optional delta (default 0.001), return a predicate
that expects its argument to be within that delta of the given value.
sourceraw docstring

defexpectcljmacro

(defexpect n & body)

Given a name (a symbol that may include metadata) and a test body, produce a standard 'clojure.test' test var (using 'deftest').

(defexpect name expected actual) is a special case shorthand for (defexpect name (expect expected actual)) provided as an easy way to migrate legacy Expectation tests to the 'clojure.test' compatibility version.

Given a name (a symbol that may include metadata) and a test body,
produce a standard 'clojure.test' test var (using 'deftest').

(defexpect name expected actual) is a special case shorthand for
(defexpect name (expect expected actual)) provided as an easy way to migrate
legacy Expectation tests to the 'clojure.test' compatibility version.
sourceraw docstring

expectcljmacro

(expect a)
(expect e a)
(expect e a ex?)
(expect e a ex? e')

Translate Expectations DSL to clojure.test language.

Translate Expectations DSL to clojure.test language.
sourceraw docstring

expectingcljmacro

(expecting string & body)

The Expectations version of clojure.test/testing.

The Expectations version of clojure.test/testing.
sourceraw docstring

from-eachcljmacro

(from-each & _)
source

functionallyclj

(functionally expected-fn actual-fn)
(functionally expected-fn actual-fn difference-fn)

Given a pair of functions, return a custom predicate that checks that they return the same result when applied to a value. May optionally accept a 'difference' function that should accept the result of each function and return a string explaininhg how they actually differ. For explaining strings, you could use expectations/strings-difference. (only when I port it across!)

Right now this produces pretty awful failure messages. FIXME!

Given a pair of functions, return a custom predicate that checks that they
return the same result when applied to a value. May optionally accept a
'difference' function that should accept the result of each function and
return a string explaininhg how they actually differ.
For explaining strings, you could use expectations/strings-difference.
(only when I port it across!)

Right now this produces pretty awful failure messages. FIXME!
sourceraw docstring

humane-test-output?clj

If Humane Test Output is available, activate it, and enable compatibility of our =? with it.

If Humane Test Output is available, activate it, and enable compatibility
of our =? with it.
sourceraw docstring

incljmacro

(in & _)
source

morecljmacro

(more & _)
source

more->cljmacro

(more-> & _)
source

more-ofcljmacro

(more-of & _)
source

side-effectscljmacro

(side-effects fn-vec & forms)
source

spec?clj

(spec? e)
source

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

× close