diff options
author | Jason Karns <jason@karns.name> | 2016-09-26 16:58:10 +0300 |
---|---|---|
committer | Jason Karns <jason@karns.name> | 2016-09-26 16:58:10 +0300 |
commit | d1c641a0793744656d283f819215686f4069ee14 (patch) | |
tree | 56e178c4527ca93f82f056452299672cf2d27ec4 | |
parent | 2300d7b70f48cf90abe4aea2437068527dd99645 (diff) |
Improve failure messageassert-refute-empty
-rw-r--r-- | src/assert.bash | 5 | ||||
-rwxr-xr-x | test/50-assert-16-refute_output.bats | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/assert.bash b/src/assert.bash index a52454a..178e299 100644 --- a/src/assert.bash +++ b/src/assert.bash @@ -336,8 +336,9 @@ refute_output() { # Matching. if (( is_mode_empty )); then if [ -n "$output" ]; then - echo 'expected no output, but output was non-empty' \ - | batslib_decorate 'unexpected output' \ + batslib_print_kv_single_or_multi 6 \ + 'output' "$output" \ + | batslib_decorate 'output non-empty, but expected no output' \ | fail fi elif (( is_mode_regexp )); then diff --git a/test/50-assert-16-refute_output.bats b/test/50-assert-16-refute_output.bats index 10c8fc4..35e6fa9 100755 --- a/test/50-assert-16-refute_output.bats +++ b/test/50-assert-16-refute_output.bats @@ -37,8 +37,8 @@ load test_helper run refute_output [ "$status" -eq 1 ] [ "${#lines[@]}" -eq 3 ] - [ "${lines[0]}" == '-- unexpected output --' ] - [ "${lines[1]}" == 'expected no output, but output was non-empty' ] + [ "${lines[0]}" == '-- output non-empty, but expected no output --' ] + [ "${lines[1]}" == 'output : a' ] [ "${lines[2]}" == '--' ] } |