nag/test/nag.bats

27 lines
665 B
Bash

#!/usr/bin/env bats
load test_helper
@test "list with no alarms prints nothing-to-nag message" {
run_nag
[ "${status}" -eq 0 ]
[ "${output}" = "Nothing to nag about." ]
}
@test "help shows usage" {
run_nag help
[ "${status}" -eq 0 ]
[[ "${output}" =~ "<time> <message...>" ]]
[[ "${output}" =~ "every <rules> <time> <message...>" ]]
[[ "${output}" =~ "stop <id>" ]]
[[ "${output}" =~ "skip <id>" ]]
[[ "${output}" =~ "check" ]]
[[ "${output}" =~ "help [<subcommand>]" ]]
[[ "${output}" =~ "Options:" ]]
}
@test "version shows version" {
run_nag version
[ "${status}" -eq 0 ]
[[ "${output}" =~ ^[0-9]+\.[0-9]+(_[a-zA-Z0-9]+)*$ ]]
}