1
0
mirror of https://github.com/sstephenson/bats.git synced 2024-11-17 11:42:33 +01:00

test/bats: Add fake tput to fix Alpine tests

The test cases that use the `-p` or `--pretty` flag would fail if `tput`
wasn't available (installed as part of the `ncurses` package). On
Alpine, `ncurses` isn't installed by default. This change ensures the
tests validate the expected behavior regardless of whether `tput` is
available.
This commit is contained in:
Mike Bland 2017-10-02 22:02:00 -04:00 committed by Bianca Tamayo
parent 6ce148b9d2
commit 1ed87ecb7f

View File

@ -11,6 +11,13 @@ filter_control_sequences() {
"$@" | sed $'s,\x1b\\[[0-9;]*[a-zA-Z],,g' "$@" | sed $'s,\x1b\\[[0-9;]*[a-zA-Z],,g'
} }
if ! command -v tput >/dev/null; then
tput() {
printf '1000\n'
}
export -f tput
fi
teardown() { teardown() {
[ -d "$TMP" ] && rm -f "$TMP"/* [ -d "$TMP" ] && rm -f "$TMP"/*
} }