FlowAssertions.Checkers (Flow Assertions v0.7.1) View Source
Functions that create handy predicates for use with FlowAssertions.MiscA.assert_good_enough/2
actual
|> assert_good_enough( in_any_order([1, 2, 3]))
"Checkers" typically provide custom failure messages that are better than what a simple predicate would provide.
This module is a work in progress, but what now works will continue to work and can be used safely. For examples of what checkers might come, see the Midje documentation. (Links are under the third bullet point of "The Core" on that page.)
Link to this section Summary
Functions
Checks whether a String or List contains another.
Check equality of Enumerables, ignoring order.
Link to this section Functions
Checks whether a String or List contains another.
[1, 2, 3] |> assert_good_enough( has_slice([2, 3]))
"abcdefg" |> assert_good_enough( has_slice("abc"))
Check equality of Enumerables, ignoring order.
actual
|> assert_good_enough( in_any_order([1, 2, 3]))
In case of error, the actual and expected enumerables are sorted by
by their Kernel.inspect/1
representation. In combination with ExUnit's
color-coded differences, that makes it easier to see what went wrong.