View Source ExKits.Macros.Assertion (ex_kits v0.2.7)

This module provides macros for performing assertions in Elixir code.

Examples

import ExKits.Macros.Assertion

# Perform a boolean assertion:
do_assert(fn -> 1 + 1 == 2 end, "1 + 1 should equal 2")

# Perform an assertion that checks if an object exists:
assert_exists(obj, "Object should exist")

# Perform an assertion that checks if an object does not exist:
assert_non_exists(obj, "Object should not exist")

Summary

Functions

Link to this macro

assert_exists(obj, error_msg)

View Source (macro)
Link to this macro

assert_non_exists(obj, error_msg)

View Source (macro)
Link to this macro

do_assert(assert_fn, error_msg)

View Source (macro)