Make _required_arguments required
This commit is contained in:
parent
c7be3223b4
commit
de3baf57e3
@ -38,4 +38,23 @@ testArgumentsNotDeclaredDoNot() {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user