Liking cljdoc? Tell your friends :D

midje.checking.checkers.simple

Prepackaged functions that perform common checks.

Prepackaged functions that perform common checks.
raw docstring

anythingclj

(anything actual)

Accepts any value.

Accepts any value.
sourceraw docstring

exactlyclj

(exactly expected)

Checks for equality. Use to avoid default handling of functions.

Checks for equality. Use to avoid default handling of functions.
sourceraw docstring

FALSEYclj

(FALSEY actual)

Returns precisely true if actual is nil or false.

Returns precisely true if actual is nil or false.
sourceraw docstring

falseyclj

(falsey actual)

Returns precisely true if actual is nil or false.

Returns precisely true if actual is nil or false.
sourceraw docstring

irrelevantclj

(irrelevant actual)

Accepts any value.

Accepts any value.
sourceraw docstring

roughlyclj

(roughly expected)
(roughly expected delta)

With two arguments, accepts a value within delta of the expected value. With one argument, the delta is 1/1000th of the expected value.

With two arguments, accepts a value within delta of the
expected value. With one argument, the delta is 1/1000th
of the expected value.
sourceraw docstring

throwsclj

(throws & desiderata)

Checks for a thrown Throwable.

The most common cases are: (fact (foo) => (throws IOException) (fact (foo) => (throws IOException #"No such file")

throws takes three kinds of arguments:

  • A class argument requires that the Throwable be of that class.
  • A string or regular expression requires that the message of the Throwable match the argument.
  • A function argument requires that the function, when applied to the Throwable, return a truthy value.

Arguments can be in any order. Except for a class argument, they can be repeated. So, for example, you can write this: (fact (foo) => (throws #"one part" #"another part"))

Checks for a thrown Throwable.

The most common cases are:
    (fact (foo) => (throws IOException)
    (fact (foo) => (throws IOException #"No such file")

`throws` takes three kinds of arguments:
* A class argument requires that the Throwable be of that class.
* A string or regular expression requires that the `message` of the Throwable
  match the argument.
* A function argument requires that the function, when applied to the Throwable,
  return a truthy value.

Arguments can be in any order. Except for a class argument, they can be repeated.
So, for example, you can write this:
    (fact (foo) => (throws #"one part" #"another part"))
sourceraw docstring

TRUTHYclj

(TRUTHY actual)

Returns precisely true if actual is not nil and not false.

Returns precisely true if actual is not nil and not false.
sourceraw docstring

truthyclj

(truthy actual)

Returns precisely true if actual is not nil and not false.

Returns precisely true if actual is not nil and not false.
sourceraw docstring

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

× close