Create teardown.bash

From https://github.com/bats-core/bats-core/issues/199
This commit is contained in:
Peter Newman
2020-12-02 19:00:09 +00:00
committed by GitHub
parent 216895fb87
commit 52f299e2b7
+12
View File
@@ -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
}