mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-18 16:27:52 +00:00
Adding mechanism to test command-line variables
This commit is contained in:
parent
a1e22f1814
commit
600f5c5725
13
run-tests
13
run-tests
@ -10,9 +10,16 @@ for TEST in tests/*.expected; do
|
||||
BASE="${TEST%.expected}"
|
||||
|
||||
echo -n "$BASE ... "
|
||||
echo "Do not read this input" | (
|
||||
. "${BASE}.env"
|
||||
mo "${BASE}.template"
|
||||
|
||||
(
|
||||
if [[ -f "${BASE}.sh" ]]; then
|
||||
# Run a shell script if one exists
|
||||
"${BASE}.sh"
|
||||
else
|
||||
# Fall back to using .env and .template
|
||||
. "${BASE}.env"
|
||||
echo "Do not read this input" | mo "${BASE}.template"
|
||||
fi
|
||||
) | diff -wU5 - "${TEST}" > "${BASE}.diff"
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
|
8
tests/help.expected
Normal file
8
tests/help.expected
Normal file
@ -0,0 +1,8 @@
|
||||
Mo is a mustache template rendering software written in bash. It inserts
|
||||
environment variables into templates.
|
||||
|
||||
Simply put, mo will change {{VARIABLE}} into the value of that
|
||||
environment variable. You can use {{#VARIABLE}}content{{/VARIABLE}} to
|
||||
conditionally display content or iterate over the values of an array.
|
||||
|
||||
Learn more about mustache templates at https://mustache.github.io/
|
4
tests/help.sh
Executable file
4
tests/help.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "${0%/*}"
|
||||
../mo --help
|
Loading…
Reference in New Issue
Block a user