mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-08 13:13:47 -05:00
fix tests
This commit is contained in:
@@ -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 ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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 ""
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user