Skip to content

Commit 9567621

Browse files
committed
Improve variable handling in test.bats.
1 parent ad0061c commit 9567621

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test.bats

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ check_commands_installed() {
1616
# Get the available commands.
1717
ddev_help_output=$(ddev help)
1818
# Find command files in the add-on.
19-
cd ${TESTDIR}
19+
cd "${TESTDIR}"
2020
tmp_file=$(mktemp)
2121
find "$GITHUB_WORKSPACE/commands" -name 'xb-*' -exec basename {} \; > "$tmp_file"
2222
# Check that all the command files got copied to the project upon installation.
@@ -46,14 +46,14 @@ health_checks() {
4646

4747
teardown() {
4848
set -eu -o pipefail
49-
cd ${TESTDIR} || ( printf "unable to cd to %s\n" ${TESTDIR} && exit 1 )
50-
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1
51-
[ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR}
49+
cd "${TESTDIR}" || ( printf "unable to cd to %s\n" "${TESTDIR}" && exit 1 )
50+
ddev delete -Oy "${PROJNAME}" >/dev/null 2>&1
51+
[ "${TESTDIR}" != "" ] && rm -rf "${TESTDIR}"
5252
}
5353

5454
@test "install from directory" {
5555
set -eu -o pipefail
56-
cd ${TESTDIR}
56+
cd "${TESTDIR}"
5757
echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
5858
ddev add-on get "${DIR}"
5959
ddev restart
@@ -63,7 +63,7 @@ teardown() {
6363
# bats test_tags=release
6464
@test "install from release" {
6565
set -eu -o pipefail
66-
cd ${TESTDIR} || ( printf "unable to cd to %s\n" ${TESTDIR} && exit 1 )
66+
cd "${TESTDIR}" || ( printf "unable to cd to %s\n" "${TESTDIR}" && exit 1 )
6767
echo "# ddev add-on get TravisCarden/ddev-drupal-xb-dev with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
6868
ddev add-on get TravisCarden/ddev-drupal-xb-dev
6969
ddev restart >/dev/null

0 commit comments

Comments
 (0)