#!/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" } testRequiredArgumentsAreRequired() { echo ' #!/usr/bin/env bash ⚡banana() { _required_argument hello echo "$_arg_hello" } ' > go echo "source $REPO_ROOT/⚡" >> go chmod +x go try ./go banana assertContains "$STDERR" "'hello' is a required argument" assertEquals 1 "$EXIT_CODE" } source $(dirname $0)/runner