fix tests

This commit is contained in:
Nathaniel Landau
2021-10-21 16:06:52 -04:00
parent 8bb89541e8
commit 3497421c4f
2 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ load 'test_helper/bats-assert/load'
######## SETUP TESTS ######## ######## SETUP TESTS ########
ROOTDIR="$(git rev-parse --show-toplevel)" ROOTDIR="$(git rev-parse --show-toplevel)"
s="${ROOTDIR}/scriptTemplate.sh" s="${ROOTDIR}/template_source_utils.sh"
if [ -f "${s}" ]; then if [ -f "${s}" ]; then
base="$(basename "${s}")" base="$(basename "${s}")"
@@ -67,7 +67,7 @@ teardown() {
assert_file_exist "${TESTDIR}/logs/log.txt" assert_file_exist "${TESTDIR}/logs/log.txt"
run cat "${TESTDIR}/logs/log.txt" run cat "${TESTDIR}/logs/log.txt"
assert_line --index 0 --regexp "\[ error\] \[.*\] This is error text \( _mainScript_:scriptTemplate.* \)" assert_line --index 0 --regexp "\[ error\] \[.*\] This is error text \( _mainScript_:${base}.* \)"
assert_line --index 1 "" assert_line --index 1 ""
} }

View File

@@ -6,7 +6,7 @@ load 'test_helper/bats-assert/load'
######## SETUP TESTS ######## ######## SETUP TESTS ########
ROOTDIR="$(git rev-parse --show-toplevel)" ROOTDIR="$(git rev-parse --show-toplevel)"
s="${ROOTDIR}/standaloneTemplate.sh" s="${ROOTDIR}/template_standalone.sh"
if [ -f "${s}" ]; then if [ -f "${s}" ]; then
base="$(basename "${s}")" base="$(basename "${s}")"
@@ -67,7 +67,7 @@ teardown() {
assert_file_exist "${TESTDIR}/logs/log.txt" assert_file_exist "${TESTDIR}/logs/log.txt"
run cat "${TESTDIR}/logs/log.txt" run cat "${TESTDIR}/logs/log.txt"
assert_line --index 0 --regexp "\[ error\] \[.*\] This is error text \( _mainScript_:standaloneTemplate.* \)" assert_line --index 0 --regexp "\[ error\] \[.*\] This is error text \( _mainScript_:${base}.* \)"
assert_line --index 1 "" assert_line --index 1 ""
} }