Allow verifying prerequisites!

This commit is contained in:
2021-12-20 21:10:46 -08:00
parent e8bc9f0655
commit c06ca5dad2
4 changed files with 46 additions and 1 deletions

35
test/test-prereqs Normal file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
testShouldBailIfRequirementsNotMet() {
echo '
#!/usr/bin/env bash
_verify-prerequisites() { false; }
hello() { echo "Hello, World!" ; }
' > go
echo "source $REPO_ROOT/⚡️" >> go
chmod +x go
try ./go
assertNotContains "$STDOUT" "hello"
assertEquals 1 "$EXIT_CODE"
}
testShouldNotBailWhenPrereqsAreAllGood() {
echo '
#!/usr/bin/env bash
_verify-prerequisites() { true; }
hello() { echo "Hello, World!" ; }
' > go
echo "source $REPO_ROOT/⚡️" >> go
chmod +x go
try ./go
assertContains "$STDOUT" "hello"
assertEquals 0 "$EXIT_CODE"
}
source $(dirname $0)/runner