You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotbare/tests/flog.bats

42 lines
761 B
Bash

#!/usr/bin/env bats
help() {
bash "${BATS_TEST_DIRNAME}"/../dotbare flog -h
}
invalid_option() {
bash "${BATS_TEST_DIRNAME}"/../dotbare flog -p
}
menu() {
export PATH="${BATS_TEST_DIRNAME}:$PATH"
bash "${BATS_TEST_DIRNAME}"/../dotbare flog
}
reset() {
export PATH="${BATS_TEST_DIRNAME}:$PATH"
bash "${BATS_TEST_DIRNAME}"/../dotbare flog --reset -y
}
@test "flog help" {
run help
[ "${status}" -eq 0 ]
[ "${lines[0]}" = "Usage: dotbare flog [-h] [-r] [-R] [-e] [-c] [-y] ..." ]
}
@test "flog invalid option" {
run invalid_option
[ "${status}" -eq 1 ]
[ "${lines[0]}" = "Invalid option: -p" ]
}
@test "flog menu" {
run menu
[ "${status}" -eq 0 ]
}
@test "flog reset" {
run reset
[[ "${output}" =~ "reset --flog_reset" ]]
}