diff --git a/test/common.bash b/test/common.bash index cd1fc95..a5554b1 100644 --- a/test/common.bash +++ b/test/common.bash @@ -68,9 +68,9 @@ teardown() { } setconfig() { - if grep -q "$2 =" "${BATS_TMPDIR}/$1"; then - sed -i "s/^$2.*/$2 = $3/" "${BATS_TMPDIR}/$1" + if grep -qe "$2\s\+=" "${BATS_TMPDIR}/$1"; then + sed -i "s/^$2\s\+=.*/$2 = $3/" "${BATS_TMPDIR}/$1" else - echo "$2 = $3/" >> "${BATS_TMPDIR}/$1" + echo "$2 = $3" >> "${BATS_TMPDIR}/$1" fi }