aboutsummaryrefslogtreecommitdiffstats
path: root/tests/justify.bats
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2025-07-12 11:09:18 -0400
committerEugene Triguba <eugenetriguba@gmail.com>2025-07-12 11:09:18 -0400
commit6a94f7837dbc295911ca65ac64ab17c3e9f3c4ee (patch)
tree31dfa3593d79e59dfefa307cb1a5bdbfb63a8804 /tests/justify.bats
parentAdd handling for zero or negative values for -w (diff)
downloadcli-6a94f7837dbc295911ca65ac64ab17c3e9f3c4ee.zip
Use exit code 0 for -h
Diffstat (limited to 'tests/justify.bats')
-rw-r--r--tests/justify.bats8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/justify.bats b/tests/justify.bats
index 6b7a275..a581c94 100644
--- a/tests/justify.bats
+++ b/tests/justify.bats
@@ -6,11 +6,19 @@ load 'vendor/bats-file/load'
JUSTIFY_BIN="./build/justify"
+@test "-h should show the usage mesage" {
+ run "${JUSTIFY_BIN}" -h
+ assert_success
+ assert_output --partial "Usage:"
+}
+
@test "-w should reject invalid values" {
run "${JUSTIFY_BIN}" -w 0
assert_failure
+ assert_output --partial "Usage:"
run "${JUSTIFY_BIN}" -w -1
assert_failure
+ assert_output --partial "Usage:"
}
@test "last line of the output is left aligned" {