chore: initial scaffolding of nag based on bash-boilerplate
This commit is contained in:
commit
d4319e1ef6
4 changed files with 507 additions and 0 deletions
27
test/nag.bats
Normal file
27
test/nag.bats
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#!/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]+)*$ ]]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue