diff --git a/test/test_helper.bash b/test/test_helper.bash index e3b03b6..c0e3a8b 100644 --- a/test/test_helper.bash +++ b/test/test_helper.bash @@ -24,3 +24,22 @@ teardown() { rm "${HOSTS_PATH}" fi } + +############################################################################### +# Helpers +############################################################################### + +# _compare() +# +# Usage: +# _compare +# +# Descriotion: +# Compare the content of a variable against an expected value. When used +# within a `@test` block the output is only displayed when the test fails. +_compare() { + local _expected="${1:-}" + local _actual="${2:-}" + printf "expected:\n%s\n" "${_expected}" + printf "actual:\n%s\n" "${_actual}" +}