dream_test/matchers/boolean
Boolean matchers for dream_test.
These matchers check boolean values and are re-exported through
dream_test/matchers.
Use them in a matcher chain when you want to assert a boolean condition.
Example
True
|> should
|> be_true()
|> or_fail_with("expected True")
Values
pub fn be_false(
value_or_result value_or_result: types.MatchResult(Bool),
) -> types.MatchResult(Bool)
Assert that a value is False.
Use this when your value is expected to be False and you want a useful
failure payload when it isn’t.
Example
False
|> should
|> be_false()
|> or_fail_with("expected False")
Parameters
value_or_result: theMatchResult(Bool)produced byshould(or a previous matcher)
Returns
A MatchResult(Bool) preserving the boolean for further chaining.
pub fn be_true(
value_or_result value_or_result: types.MatchResult(Bool),
) -> types.MatchResult(Bool)
Assert that a value is True.
Use this when your value is expected to be True and you want a useful
failure payload when it isn’t.
Example
True
|> should
|> be_true()
|> or_fail_with("expected True")
Parameters
value_or_result: theMatchResult(Bool)produced byshould(or a previous matcher)
Returns
A MatchResult(Bool) preserving the boolean for further chaining.