From 52f299e2b7a11e65b40d1b7dbeca7023eb1e8617 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 2 Dec 2020 19:00:09 +0000 Subject: [PATCH] Create teardown.bash From https://github.com/bats-core/bats-core/issues/199 --- test/teardown.bash | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/teardown.bash diff --git a/test/teardown.bash b/test/teardown.bash new file mode 100644 index 0000000..fc7a98a --- /dev/null +++ b/test/teardown.bash @@ -0,0 +1,12 @@ +teardown() { + if ((BATS_ERROR_STATUS));then + echo "Failed with status $BATS_ERROR_STATUS" + if [[ "${output}" != "" ]];then + echo "Output at that time was:" + echo "$output" + else + echo "Output was empty" + fi + return $BATS_ERROR_STATUS + fi +}