2020-07-02 12:10:44 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-04-08 12:11:56 +02:00
|
|
|
setup() {
|
|
|
|
use_shim 'batwatch'
|
|
|
|
}
|
|
|
|
|
|
|
|
test:version() {
|
|
|
|
description "Test 'batwatch --version'"
|
2020-07-02 12:10:44 +02:00
|
|
|
snapshot stdout
|
|
|
|
snapshot stderr
|
2020-04-08 12:11:56 +02:00
|
|
|
|
2020-04-27 10:22:22 +02:00
|
|
|
batwatch --version | awk 'FNR <= 1 { print $1 }'
|
2020-04-08 12:11:56 +02:00
|
|
|
batwatch --version | awk 'p{print} /^$/ { p=1 }'
|
|
|
|
}
|
2020-07-02 12:10:44 +02:00
|
|
|
|
|
|
|
test:help() {
|
|
|
|
description "Test 'batwatch --help'"
|
|
|
|
snapshot stdout
|
|
|
|
batwatch --help
|
|
|
|
|
|
|
|
assert batwatch --help
|
|
|
|
batwatch --help | grep -q 'Usage'
|
|
|
|
}
|
|
|
|
|
2020-07-06 10:18:53 +02:00
|
|
|
test:displayed() {
|
|
|
|
description "Test 'batwatch <file>': <file> should be displayed'"
|
|
|
|
snapshot stdout
|
2020-07-02 12:10:44 +02:00
|
|
|
|
2020-07-06 10:18:53 +02:00
|
|
|
batwatch --no-clear --watcher poll file.sh <<< "q"
|
|
|
|
batwatch --watcher poll file.sh <<< "q" | grep -q "Hello"
|
2020-07-02 12:10:44 +02:00
|
|
|
}
|