42 lines
659 B
Plaintext
42 lines
659 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
testArgumentsBecomeVars() {
|
||
|
echo '
|
||
|
#!/usr/bin/env bash
|
||
|
|
||
|
⚡banana() {
|
||
|
_argument hello
|
||
|
if [[ -n "$_arg_hello" ]]; then
|
||
|
echo "I AM A BANANA"
|
||
|
fi
|
||
|
}
|
||
|
' > go
|
||
|
|
||
|
echo "source $REPO_ROOT/⚡" >> go
|
||
|
chmod +x go
|
||
|
|
||
|
try ./go banana hello=please
|
||
|
assertEquals "I AM A BANANA" "$STDOUT"
|
||
|
}
|
||
|
|
||
|
testArgumentsNotDeclaredDoNot() {
|
||
|
echo '
|
||
|
#!/usr/bin/env bash
|
||
|
|
||
|
⚡banana() {
|
||
|
_argument hello
|
||
|
if [[ -n "$_arg_goodbye" ]]; then
|
||
|
echo "I AM A BANANA"
|
||
|
fi
|
||
|
}
|
||
|
' > go
|
||
|
|
||
|
echo "source $REPO_ROOT/⚡" >> go
|
||
|
chmod +x go
|
||
|
|
||
|
try ./go banana goodbye=foo
|
||
|
assertEquals "" "$STDOUT"
|
||
|
}
|
||
|
|
||
|
source $(dirname $0)/runner
|