(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
match but using strict equals
matching behavior for maps, even nested ones.
match but using strict `equals` matching behavior for maps, even nested ones.
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
(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)) (str "greater than " 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)) (str "greater than " expected-long))) (match-with {java.lang.Long greater-than-matcher})` NOTE: currently doesn't work in midje `provided` expressions
(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
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close