View Source Machete.TruthyMatcher (Machete v0.2.3)

Defines a matcher that matches truthy values

Link to this section Summary

Types

Describes the arguments that can be passed to this matcher

t()

Describes an instance of this matcher

Link to this section Types

@type opts() :: []

Describes the arguments that can be passed to this matcher

@opaque t()

Describes an instance of this matcher

Link to this section Functions

@spec truthy(opts()) :: t()

Matches against truthy values.

Takes no arguments

Examples:

iex> assert true ~> truthy()
true

iex> assert 123 ~> truthy()
true

iex> refute false ~> truthy()
false

iex> refute nil ~> truthy()
false