aboutsummaryrefslogtreecommitdiffstats
path: root/community/bats/0001-test-bats-Add-fake-tput-to-fix-Alpine-tests.patch
diff options
context:
space:
mode:
authorHenrik Riomar <henrik.riomar@gmail.com>2017-12-30 23:26:35 +0100
committerJakub Jirutka <jakub@jirutka.cz>2017-12-31 22:21:59 +0100
commitb8da9232a21e6b0637bca8a513df4598517653bb (patch)
tree18815a2a9b89e58a9425e5a1a45d8f0a95c28875 /community/bats/0001-test-bats-Add-fake-tput-to-fix-Alpine-tests.patch
parent90f33cc9f72ac76e0f12c79629b1816f34b2764e (diff)
community/bats: add check()
The patch is from https://github.com/bats-core/bats-core
Diffstat (limited to 'community/bats/0001-test-bats-Add-fake-tput-to-fix-Alpine-tests.patch')
-rw-r--r--community/bats/0001-test-bats-Add-fake-tput-to-fix-Alpine-tests.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/community/bats/0001-test-bats-Add-fake-tput-to-fix-Alpine-tests.patch b/community/bats/0001-test-bats-Add-fake-tput-to-fix-Alpine-tests.patch
new file mode 100644
index 00000000000..1b29f819492
--- /dev/null
+++ b/community/bats/0001-test-bats-Add-fake-tput-to-fix-Alpine-tests.patch
@@ -0,0 +1,35 @@
+From 1ed87ecb7f0b8f2be4c04aed242f2114975ab8e1 Mon Sep 17 00:00:00 2001
+From: Mike Bland <mbland@acm.org>
+Date: Mon, 2 Oct 2017 22:02:00 -0400
+Subject: [PATCH] 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.
+---
+ test/test_helper.bash | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/test/test_helper.bash b/test/test_helper.bash
+index 302f743..af89003 100644
+--- a/test/test_helper.bash
++++ b/test/test_helper.bash
+@@ -11,6 +11,13 @@ 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"/*
+ }
+--
+2.15.0
+