mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-18 16:27:52 +00:00
Merge remote-tracking branch 'tai/master'
This commit is contained in:
commit
4f7fd392b0
13
run-tests
13
run-tests
@ -10,9 +10,16 @@ for TEST in tests/*.expected; do
|
|||||||
BASE="${TEST%.expected}"
|
BASE="${TEST%.expected}"
|
||||||
|
|
||||||
echo -n "$BASE ... "
|
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"
|
) | diff -wU5 - "${TEST}" > "${BASE}.diff"
|
||||||
|
|
||||||
if [[ $? -ne 0 ]]; then
|
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