View Source SimpleAssert (simple_assert v0.1.0)

SimpleAssert asserts the given parameter is true or false.

Link to this section Summary

Functions

Asserts the e is true.

Asserts the e is false or nil.

Link to this section Functions

Specs

assert(boolean()) :: :ok | none()

Asserts the e is true.

If it succeeds, it returns :ok. Raises an error otherwise.

Examples

iex> SimpleAssert.assert(1 == 1)
:ok

iex> SimpleAssert.assert(1 == 2)
** (ArgumentError) assertion failed!

Specs

assert_false(any()) :: :ok | none()

Asserts the e is false or nil.

If it succeeds, it returns :ok. Raises an error otherwise.

Examples

iex> SimpleAssert.assert_false(false)
:ok

iex> SimpleAssert.assert_false(nil)
:ok

iex> SimpleAssert.assert_false(:unexpected_result)
** (ArgumentError) assertion failed!