mirror of
https://github.com/sstephenson/bats.git
synced 2024-11-17 11:42:33 +01:00
1ed87ecb7f
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.
24 lines
395 B
Bash
24 lines
395 B
Bash
fixtures() {
|
|
FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures/$1"
|
|
bats_trim_filename "$FIXTURE_ROOT" 'RELATIVE_FIXTURE_ROOT'
|
|
}
|
|
|
|
setup() {
|
|
export TMP="$BATS_TEST_DIRNAME/tmp"
|
|
}
|
|
|
|
filter_control_sequences() {
|
|
"$@" | 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() {
|
|
[ -d "$TMP" ] && rm -f "$TMP"/*
|
|
}
|