2021-12-21 05:10:46 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
testShouldBailIfRequirementsNotMet() {
|
|
|
|
echo '
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
_verify-prerequisites() { false; }
|
2021-12-21 06:48:10 +00:00
|
|
|
⚡hello() { echo "Hello, World!" ; }
|
2021-12-21 05:10:46 +00:00
|
|
|
' > go
|
|
|
|
|
2021-12-21 06:48:10 +00:00
|
|
|
echo "source $REPO_ROOT/⚡" >> go
|
2021-12-21 05:10:46 +00:00
|
|
|
chmod +x go
|
|
|
|
|
|
|
|
try ./go
|
|
|
|
assertNotContains "$STDOUT" "hello"
|
|
|
|
assertEquals 1 "$EXIT_CODE"
|
|
|
|
}
|
|
|
|
|
|
|
|
testShouldNotBailWhenPrereqsAreAllGood() {
|
|
|
|
echo '
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
_verify-prerequisites() { true; }
|
2021-12-21 06:48:10 +00:00
|
|
|
⚡hello() { echo "Hello, World!" ; }
|
2021-12-21 05:10:46 +00:00
|
|
|
' > go
|
|
|
|
|
2021-12-21 06:48:10 +00:00
|
|
|
echo "source $REPO_ROOT/⚡" >> go
|
2021-12-21 05:10:46 +00:00
|
|
|
chmod +x go
|
|
|
|
|
|
|
|
try ./go
|
|
|
|
assertContains "$STDOUT" "hello"
|
|
|
|
assertEquals 0 "$EXIT_CODE"
|
|
|
|
}
|
|
|
|
|
|
|
|
source $(dirname $0)/runner
|