diff --git a/tests/test.bats b/tests/test.bats index fd54343..ee8eaa8 100644 --- a/tests/test.bats +++ b/tests/test.bats @@ -1,4 +1,5 @@ setup() { + set -eu -o pipefail export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." export TESTDIR=~/tmp/testelasticsearch mkdir -p $TESTDIR @@ -11,12 +12,14 @@ setup() { } teardown() { + set -eu -o pipefail cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) - ddev delete -Oy ${DDEV_SITENAME} + ddev delete -Oy ${PROJNAME} || true [ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR} } @test "install from directory" { + set -eu -o pipefail cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 ddev get ${DIR} @@ -26,6 +29,7 @@ teardown() { } @test "install from release" { + set -eu -o pipefail cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) echo "# ddev get drud/ddev-elasticsearch with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 ddev get drud/ddev-elasticsearch