36 lines
525 B
Bash
36 lines
525 B
Bash
#!/usr/bin/env bash
|
||
|
||
testGoodMessageShouldBeGreen() {
|
||
echo '
|
||
#!/usr/bin/env bash
|
||
|
||
⚡️hello() {
|
||
_good-message "hello"
|
||
}
|
||
' > go
|
||
|
||
echo "source $REPO_ROOT/⚡️" >> go
|
||
chmod +x go
|
||
|
||
try ./go hello
|
||
assertEquals "[32mhello[0m" "$STDOUT"
|
||
}
|
||
|
||
testBadMessageShouldBeRed() {
|
||
echo '
|
||
#!/usr/bin/env bash
|
||
|
||
⚡️hello() {
|
||
_bad-message "hello"
|
||
}
|
||
' > go
|
||
|
||
echo "source $REPO_ROOT/⚡️" >> go
|
||
chmod +x go
|
||
|
||
try ./go hello
|
||
assertEquals "[31mhello[0m" "$STDOUT"
|
||
}
|
||
|
||
source $(dirname $0)/runner
|