mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-14 20:39:55 -05:00
Bats: show output on failed assertions
This commit is contained in:
parent
f504b01818
commit
c6c4e41eb9
1 changed files with 4 additions and 2 deletions
|
@ -44,7 +44,8 @@ flunk() {
|
||||||
|
|
||||||
assert_success() {
|
assert_success() {
|
||||||
if [ "$status" -ne 0 ]; then
|
if [ "$status" -ne 0 ]; then
|
||||||
flunk "command failed with exit status $status"
|
flunk "command failed with exit status $status" $'\n'\
|
||||||
|
"output: $output"
|
||||||
elif [ "$#" -gt 0 ]; then
|
elif [ "$#" -gt 0 ]; then
|
||||||
assert_output "$1"
|
assert_output "$1"
|
||||||
fi
|
fi
|
||||||
|
@ -52,7 +53,8 @@ assert_success() {
|
||||||
|
|
||||||
assert_failure() {
|
assert_failure() {
|
||||||
if [ "$status" -eq 0 ]; then
|
if [ "$status" -eq 0 ]; then
|
||||||
flunk "expected failed exit status"
|
flunk "expected failed exit status" $'\n'\
|
||||||
|
"output: $output"
|
||||||
elif [ "$#" -gt 0 ]; then
|
elif [ "$#" -gt 0 ]; then
|
||||||
assert_output "$1"
|
assert_output "$1"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue