Liking cljdoc? Tell your friends :D

lazytest.core


base-fieldscljmacro

(base-fields &form expr doc & body)

Useful for all expectations. Sets the base properties on the ExpectationFailed.

Useful for all expectations. Sets the base
properties on the ExpectationFailed.
sourceraw docstring

cause-seqclj

(cause-seq throwable)

Given a Throwable, returns a sequence of causes. The first element of the sequence is the given throwable itself.

Given a Throwable, returns a sequence of causes. The first element
of the sequence is the given throwable itself.
sourceraw docstring

causes-with-msg?clj

(causes-with-msg? c re f)

Calls f with no arguments; catches exceptions with an instance of class c in their cause chain. If the message of the causing exception does not match re (with re-find), throws ExpectationFailed. Any non-matching exception will be re-thrown. Returns false if f throws no exceptions.

Useful in expect-it or expect.

Calls f with no arguments; catches exceptions with an instance of
class c in their cause chain. If the message of the causing
exception does not match re (with re-find), throws
ExpectationFailed. Any non-matching exception will be re-thrown.
Returns false if f throws no exceptions.

Useful in `expect-it` or `expect`.
sourceraw docstring

causes?clj

(causes? c f)

Calls f with no arguments; returns true if it throws an exception whose cause chain includes an instance of class c. Any other exception will be re-thrown. Returns false if f throws no exceptions.

Useful in expect-it or expect.

Calls f with no arguments; returns true if it throws an exception
whose cause chain includes an instance of class c. Any other
exception will be re-thrown. Returns false if f throws no
exceptions.

Useful in `expect-it` or `expect`.
sourceraw docstring

defdescribecljmacro

(defdescribe test-name & children)
(defdescribe test-name sym? doc? attr-map? & children)

describe helper that assigns a describe call to a Var of the given name.

test-name is a symbol.

doc (optional) is a documentation string.

attr-map (optional) is a metadata map.

children are test cases (see 'it') or nested test suites (see 'describe').

`describe` helper that assigns a `describe` call to a Var of the given name.

test-name is a symbol.

doc (optional) is a documentation string.

attr-map (optional) is a metadata map.

children are test cases (see 'it') or nested test suites (see 'describe').
sourceraw docstring

describecljmacro

(describe & children)
(describe sym? doc? attr-map? & children)

Defines a suite of tests.

sym (optional) is a symbol; if present, it will be resolved in the current namespace and prepended to the documentation string.

doc (optional) is a documentation string.

attr-map (optional) is a metadata map.

children are test cases or nested test suites.

Defines a suite of tests.

sym (optional) is a symbol; if present, it will be resolved in the current namespace and prepended to the documentation string.

doc (optional) is a documentation string.

attr-map (optional) is a metadata map.

children are test cases or nested test suites.
sourceraw docstring

expectcljmacro

(expect expr)
(expect expr docstring)

Evaluates expression. If it returns logical true, returns that result. If the expression returns logical false, throws lazytest.ExpectationFailed with an attached map describing the reason for failure. Metadata on expr and on the 'expect' form itself will be merged into the failure map.

Evaluates expression. If it returns logical true, returns that
result. If the expression returns logical false, throws
lazytest.ExpectationFailed with an attached map describing the
reason for failure. Metadata on expr and on the 'expect' form
itself will be merged into the failure map.
sourceraw docstring

expect-itcljmacro

(expect-it expr)
(expect-it doc? attr-map? expr)

Defines a single test case that wraps the given expr in an expect call.

body is: doc? attr-map? expr

doc (optional) is a documentation string

attr-map (optional) is a metadata map

expr is a single expression, which must return logical true to indicate the test case passes or logical false to indicate failure.

Defines a single test case that wraps the given expr in an `expect` call.

body is: doc? attr-map? expr

doc (optional) is a documentation string

attr-map (optional) is a metadata map

expr is a single expression, which must return logical true to
indicate the test case passes or logical false to indicate failure.
sourceraw docstring

givencljmacro

(given bindings & body)

Like 'let' but returns the expressions of body in a vector. Suitable for nesting inside 'describe'.

Like 'let' but returns the expressions of body in a vector.
Suitable for nesting inside 'describe'.
sourceraw docstring

itcljmacro

(it & body)
(it doc? attr-map? & body)

Defines a single test case that may execute arbitrary code.

doc (optional) is a documentation string

attr-map (optional) is a metadata map

body is any code, which must throw an exception (such as with 'expect') to indicate failure. If the code completes without throwing any exceptions, the test case has passed.

NOTE: Because failure requires an exception, no assertions after the thrown exception will be run.

Defines a single test case that may execute arbitrary code.

doc (optional) is a documentation string

attr-map (optional) is a metadata map

body is any code, which must throw an exception (such as with
'expect') to indicate failure. If the code completes without
throwing any exceptions, the test case has passed.

NOTE: Because failure requires an exception, no assertions after
the thrown exception will be run.
sourceraw docstring

ok?clj

(ok? f)

Calls f and discards its return value. Returns true if f does not throw any exceptions.

Useful in expect-it or expect.

Calls f and discards its return value. Returns true if f does not
throw any exceptions.

Useful in `expect-it` or `expect`.
sourceraw docstring

throws-with-msg?clj

(throws-with-msg? c re f)

Calls f with no arguments; catches exceptions of class c. If the message of the caught exception does not match re (with re-find), throws ExpectationFailed. Any other exception not of class c will be re-thrown. Returns false if f throws no exceptions.

Useful in expect-it or expect.

Calls f with no arguments; catches exceptions of class c. If the
message of the caught exception does not match re (with re-find),
throws ExpectationFailed. Any other exception not of class c will
be re-thrown. Returns false if f throws no exceptions.

Useful in `expect-it` or `expect`.
sourceraw docstring

throws?clj

(throws? c f)

Calls f with no arguments; returns true if it throws an instance of class c. Any other exception will be re-thrown. Returns false if f throws no exceptions.

Useful in expect-it or expect.

Calls f with no arguments; returns true if it throws an instance of
class c. Any other exception will be re-thrown. Returns false if f
throws no exceptions.

Useful in `expect-it` or `expect`.
sourceraw docstring

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

× close