diff options
Diffstat (limited to 'test/cases/lib-messages.bats')
-rw-r--r-- | test/cases/lib-messages.bats | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/test/cases/lib-messages.bats b/test/cases/lib-messages.bats index d0b4497..c992a33 100644 --- a/test/cases/lib-messages.bats +++ b/test/cases/lib-messages.bats @@ -1,19 +1,16 @@ -#!/usr/bin/env roundup +load ../lib/common -describe libremessages -. ./test-common.sh - -it_can_be_included_twice() ( +@test "libremessages can be included twice" ( . libremessages . libremessages ) -it_can_be_included_with_set_euE() ( +@test "libremessages can be included with set euE" ( set -euE . libremessages ) -it_works_with_no_color_and_set_euE() { +@test "libremessages works with no color and set euE" { ( unset TERM set -euE @@ -25,19 +22,19 @@ it_works_with_no_color_and_set_euE() { not empty $tmpdir/stderr } -it_can_be_called_without_including() { +@test "libremessages can be called without including" { libremessages msg Foo >$tmpdir/stdout 2>$tmpdir/stderr empty $tmpdir/stdout not empty $tmpdir/stderr } -it_fails_with_msg_and_no_args() { +@test "libremessages fails with msg and no args" { libremessages msg || status=$? [[ $status != 0 ]] } -it_allows_subheadings_to_flag() { +@test "libremessages allows subheadings to flag" { # Note that old versions of `flag` panicked if given an odd # number of headings, so give an odd number here. libremessages flag \ @@ -54,7 +51,7 @@ it_allows_subheadings_to_flag() { diff -u $tmpdir/exp $tmpdir/out } -it_is_quiet_on_stdout_on_errs() { +@test "libremessages is quiet on stdout on errs" { LC_ALL=C bash -euE -c '. libremessages; setup_traps; false' >"$tmpdir/stdout" 2>"$tmpdir/stderr" || status=$? [[ $status != 0 ]] |