mirror of
https://github.com/octoleo/hosts.git
synced 2024-11-21 20:35:10 +00:00
Improve test failure messages.
This commit is contained in:
parent
c41b0ada74
commit
16c7484c17
@ -26,6 +26,8 @@ load test_helper
|
||||
run "${_HOSTS}" backups
|
||||
printf "\${status}: %s\\n" "${status}"
|
||||
printf "\${output}: '%s'\\n" "${output}"
|
||||
printf "\${_HOSTS_TEMP_PATH}: '%s'\\n" "${_HOSTS_TEMP_PATH}"
|
||||
printf "\${HOSTS_PATH}: '%s'\\n" "${HOSTS_PATH}"
|
||||
_expected="\
|
||||
No backups found. Create a new backup:
|
||||
hosts backups create"
|
||||
@ -42,6 +44,8 @@ No backups found. Create a new backup:
|
||||
run "${_HOSTS}" backups
|
||||
printf "\${status}: %s\\n" "${status}"
|
||||
printf "\${output}: '%s'\\n" "${output}"
|
||||
printf "\${_HOSTS_TEMP_PATH}: '%s'\\n" "${_HOSTS_TEMP_PATH}"
|
||||
printf "\${HOSTS_PATH}: '%s'\\n" "${HOSTS_PATH}"
|
||||
[[ "${lines[0]}" =~ hosts_test ]]
|
||||
[[ "${lines[0]}" =~ '--backup-' ]]
|
||||
[[ "${lines[1]}" =~ hosts_test ]]
|
||||
|
@ -14,7 +14,7 @@ setup() {
|
||||
|
||||
export _HOSTS_TEMP_DIR="/tmp"
|
||||
export _HOSTS_TEMP_PATH
|
||||
_HOSTS_TEMP_PATH="$(mktemp ${_HOSTS_TEMP_DIR}/hosts_test.XXXXXX)" || exit 1
|
||||
_HOSTS_TEMP_PATH="$(mktemp "${_HOSTS_TEMP_DIR}/hosts_test.XXXXXX")" || exit 1
|
||||
cat "${BATS_TEST_DIRNAME}/fixtures/hosts" > "${_HOSTS_TEMP_PATH}"
|
||||
|
||||
export HOSTS_PATH="${_HOSTS_TEMP_PATH}"
|
||||
|
Loading…
Reference in New Issue
Block a user