test: splits monolith into a bats file for each subcommand

This commit is contained in:
Lewis Wynne 2026-04-02 11:39:48 +01:00
parent b6fde582bb
commit 2a3c9f264f
10 changed files with 535 additions and 458 deletions

24
test/mute.bats Normal file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bats
load test_helper
@test "mute creates muted file" {
run_nag mute
[ "${status}" -eq 0 ]
[[ "${output}" =~ "muted" ]]
[ -f "${NAG_DIR}/muted" ]
}
@test "unmute removes muted file" {
run_nag mute
run_nag unmute
[ "${status}" -eq 0 ]
[[ "${output}" =~ "unmuted" ]]
[ ! -f "${NAG_DIR}/muted" ]
}
@test "unmute when not muted says so" {
run_nag unmute
[ "${status}" -eq 0 ]
[[ "${output}" =~ "not muted" ]]
}