2021-12-21 04:51:18 +00:00
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
testGoodMessageShouldBeGreen() {
|
|
|
|
|
echo '
|
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2021-12-21 06:48:10 +00:00
|
|
|
|
⚡hello() {
|
2021-12-21 04:51:18 +00:00
|
|
|
|
_good-message "hello"
|
|
|
|
|
}
|
|
|
|
|
' > go
|
|
|
|
|
|
2021-12-21 06:48:10 +00:00
|
|
|
|
echo "source $REPO_ROOT/⚡" >> go
|
2021-12-21 04:51:18 +00:00
|
|
|
|
chmod +x go
|
|
|
|
|
|
|
|
|
|
try ./go hello
|
|
|
|
|
assertEquals "[32mhello[0m" "$STDOUT"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
testBadMessageShouldBeRed() {
|
|
|
|
|
echo '
|
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2021-12-21 06:48:10 +00:00
|
|
|
|
⚡hello() {
|
2021-12-21 04:51:18 +00:00
|
|
|
|
_bad-message "hello"
|
|
|
|
|
}
|
|
|
|
|
' > go
|
|
|
|
|
|
2021-12-21 06:48:10 +00:00
|
|
|
|
echo "source $REPO_ROOT/⚡" >> go
|
2021-12-21 04:51:18 +00:00
|
|
|
|
chmod +x go
|
|
|
|
|
|
|
|
|
|
try ./go hello
|
|
|
|
|
assertEquals "[31mhello[0m" "$STDOUT"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
source $(dirname $0)/runner
|