Liking cljdoc? Tell your friends :D

matcher-combinators.midje


check-matchclj

(check-match matcher actual)
source

matchclj

(match matcher)

Takes in a matcher and returns a checker that asserts that the provided value satisfies the matcher

Takes in a matcher and returns a checker that asserts that the provided value satisfies the matcher
sourceraw docstring

match-equalsclj

match but using strict equals matching behavior for maps, even nested ones.

match but using strict `equals` matching behavior for maps, even nested ones.
sourceraw docstring

match-roughlyclj

match where all numbers match if they are within the delta of their expected value

match where all numbers match if they are within the delta of their expected value
sourceraw docstring

match-withcljmacro

(match-with & args)

Validates that the provided values satisfies the matcher but uses the provided type->matcher map to redefine the default matchers used for the specified types.

By default when the system sees a java.lang.Long it applies the equals matcher to it. So if, for example, we want to check that all Longs are greater than whatever Long provided in the matcher, we would do:

`(defn greater-than-matcher [expected-long] (matcher-combinators.core/->PredMatcher (fn [actual] (> actual expected-long))))

(match-with {java.lang.Long greater-than-matcher})`

NOTE: currently doesn't work in midje provided expressions

Validates that the provided values satisfies the matcher but
uses the provided type->matcher map to redefine the default
matchers used for the specified types.

By default when the system sees a `java.lang.Long` it applies
the `equals` matcher to it.  So if, for example, we want to
check that all Longs are greater than whatever Long provided
in the matcher, we would do:

`(defn greater-than-matcher [expected-long]
   (matcher-combinators.core/->PredMatcher
     (fn [actual] (> actual expected-long))))

(match-with {java.lang.Long greater-than-matcher})`

NOTE: currently doesn't work in midje `provided` expressions
sourceraw docstring

throws-matchclj

(throws-match & args)

Takes in a matcher or a matcher and throwable subclass. Returns a checker that asserts an exception was raised and the ex-data within it satisfies the matcher

Takes in a matcher or a matcher and throwable subclass.
Returns a checker that asserts an exception was raised and the ex-data within it satisfies the matcher
sourceraw docstring

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

× close