Liking cljdoc? Tell your friends :D

expectations.clojure.test

This namespace provides compatibility with clojure.test and related tooling. This namespace can be used standalone, without requiring the 'expectations' namespace -- all functionality from that namespace is exposed via this one.

When this namespace is loaded, the 'run on shutdown' hook is automatically disabled -- tests are named functions that get run explicitly instead.

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

This namespace provides compatibility with clojure.test and related tooling.
This namespace can be used standalone, without requiring the 'expectations'
namespace -- all functionality from that namespace is exposed via this one.

When this namespace is loaded, the 'run on shutdown' hook is automatically
disabled -- tests are named functions that get run explicitly instead.

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

*prune-stacktrace*clj

source

*report-counters*clj

source

*test-meta*clj

source

*test-name*clj

source

*test-var*clj

source

->failure-messageclj

(->failure-message {:keys [raw ref-data result expected-message actual-message
                           message list show-raw]})
source

->test-reportclj

(->test-report m s x k)

Given a test report map, a symbolic form, a value (produced from it), and the next report key (:actual or :expected), merge in more elements to build up a test report that clojure.test can use to report the failure, based either on the form or the value, or both.

Given a test report map, a symbolic form, a value (produced from it), and
the next report key (:actual or :expected), merge in more elements to build
up a test report that clojure.test can use to report the failure, based
either on the form or the value, or both.
sourceraw docstring

->varsclj

(->vars ns)
source

actual-messageclj

(actual-message e a str-e str-a)
source

add-watch-every-iref-for-updatesclj

(add-watch-every-iref-for-updates iref-vars)
source

ansiclj

(ansi code)
source

ansi-colorsclj

source

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

by-kindclj

(by-kind vars)
source

clean-up-exceptionclj

(clean-up-exception ex)

Given an expected exception, return a simpler representation of it that clojure.test's reporting can display nicely.

Given an expected exception, return a simpler representation of it that
clojure.test's reporting can display nicely.
sourceraw docstring

colorclj

(color code & s)
source

colorize-choiceclj

(colorize-choice)
source

colorize-filenameclj

(colorize-filename s)
source

colorize-rawclj

(colorize-raw s)
source

colorize-resultsclj

(colorize-results pred s)
source

colorize-warnclj

(colorize-warn s)
source

compare-exprcljmultimethod

source

contextcljmacro

(context [sym-kw val & contexts :as args] & forms)
source

create-contextclj

(create-context in-context-vars work)
source

CustomPredcljprotocol

source

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

disable-run-on-shutdownclj

(disable-run-on-shutdown)
source

doexpectcljmacro

(doexpect e a)
source

execute-varsclj

(execute-vars vars)
source

expandingcljmacro

(expanding n)
source

expectcljmacro

(expect a)
(expect e a)

Expectations' equivalent to clojure.test's 'is' macro.

Expectations' equivalent to clojure.test's 'is' macro.
sourceraw docstring

expect-fnclj

(expect-fn e a)
source

expect-focusedcljmacro

(expect-focused a)
(expect-focused e a)
source

expectation-finishedclj

(expectation-finished a-var)
source

expected-messageclj

(expected-message e a str-e str-a)
source

expectingcljmacro

(expecting string & body)

The Expectations version of clojure.test/testing.

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

failclj

(fail test-name test-meta msg)
source

find-failuresclj

(find-failures the-seq)
source

find-successesclj

(find-successes the-seq)
source

finishedclj

(finished test-name test-meta)
source

fold-messages-togetherclj

(fold-messages-together m)

Given a test report, attempt to fold in additional information from our Expectations report so that clojure.test can provide more details.

Given a test report, attempt to fold in additional information from our
Expectations report so that clojure.test can provide more details.
sourceraw docstring

freeze-timecljmacro

(freeze-time time & forms)
source

from-eachcljmacro

(from-each seq-exprs body-expr)
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.

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.
sourceraw docstring

ignored-fnsclj

(ignored-fns {:keys [className fileName]})
source

inclj

(in n)
source

inc-report-counterclj

(inc-report-counter name)
source

initial-report-countersclj

source

localizecljmultimethod

source

messageclj

(message e a str-e str-a)
source

morecljmacro

(more & expects)
source

more->cljmacro

(more-> & expect-pairs)
source

more-ofcljmacro

(more-of let-sexp & expect-pairs)
source

no-opclj

(no-op & _)
source

ns-finishedclj

(ns-finished a-ns)
source

pp-strclj

(pp-str e)
source

pruned-stack-traceclj

(pruned-stack-trace t)
source

raw-strclj

(raw-str [e a])
source

readmeclj

(readme)
(readme readme-path test-path)

If invoked with no arguments, as happens when this namespace is loaded, then based on environment variables and system properties, parse the specified file (normally a readme) and generate a test file based on the Clojure code fragments found inside it. Can also be invoked with the path of the readme source file and the output path for the generated readme.clj test file. This arity is intended for use by tooling that wants to directly control this operation.

If invoked with no arguments, as happens when this namespace is loaded,
then based on environment variables and system properties, parse the
specified file (normally a readme) and generate a test file based on the
Clojure code fragments found inside it.
Can also be invoked with the path of the readme source file and the output
path for the generated readme.clj test file. This arity is intended for
use by tooling that wants to directly control this operation.
sourceraw docstring

redef-statecljmacro

(redef-state namespaces & forms)
source

reminderclj

source

remove-watch-every-iref-for-updatesclj

(remove-watch-every-iref-for-updates iref-vars)
source

reportcljmultimethod

source

run-all-testsclj

(run-all-tests)
(run-all-tests re)
source

run-testsclj

(run-tests namespaces)
source

run-tests-in-varsclj

(run-tests-in-vars vars-by-kind)
source

run-tests-on-shutdownclj

source

show-raw-choiceclj

(show-raw-choice)
source

side-effectscljmacro

(side-effects fn-vec & forms)
source

startedclj

(started test-name test-meta)
source

string-joinclj

(string-join s coll)
source

strings-differenceclj

(strings-difference e a)
source

summaryclj

(summary msg)
source

test-fileclj

(test-file {:keys [file line]})
source

test-nameclj

(test-name {:keys [line ns]})
source

test-varclj

(test-var v)
source

test-varsclj

(test-vars vars-by-kind ignored-expectations)
source

var-kindclj

(var-kind v)
source

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

× close