dream_test/matchers/boolean

Boolean matchers for dream_test.

These matchers check boolean values. They’re re-exported through dream_test/assertions/should.

Usage

import dream_test/assertions/should.{should, be_true, be_false, or_fail_with}

is_valid(input)
|> should()
|> be_true()
|> or_fail_with("Input should be valid")

is_empty(list)
|> should()
|> be_false()
|> or_fail_with("List should not be empty")

Values

pub fn be_false(
  value_or_result: types.MatchResult(Bool),
) -> types.MatchResult(Bool)

Assert that a value is False.

Example

is_empty(list)
|> should()
|> be_false()
|> or_fail_with("List should not be empty")
pub fn be_true(
  value_or_result: types.MatchResult(Bool),
) -> types.MatchResult(Bool)

Assert that a value is True.

Example

is_valid(input)
|> should()
|> be_true()
|> or_fail_with("Input should be valid")
Search Document