mirror of https://github.com/kazhala/dotbare
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.
32 lines
588 B
Bash
32 lines
588 B
Bash
#!/usr/bin/env bats
|
|
|
|
help() {
|
|
bash "${BATS_TEST_DIRNAME}"/../dotbare fupgrade -h
|
|
}
|
|
|
|
invalid_option() {
|
|
bash "${BATS_TEST_DIRNAME}"/../dotbare fupgrade -p
|
|
}
|
|
|
|
upgrade() {
|
|
bash "${BATS_TEST_DIRNAME}"/../dotbare fupgrade
|
|
}
|
|
|
|
@test "fupgrade help" {
|
|
run help
|
|
[ "${status}" -eq 0 ]
|
|
[ "${lines[0]}" = "Usage: dotbare fupgrade [-h] ..." ]
|
|
}
|
|
|
|
@test "fupgrade invliad option" {
|
|
run invalid_option
|
|
[ "${status}" -eq 1 ]
|
|
[ "${lines[0]}" = "Invalid option: p" ]
|
|
}
|
|
|
|
@test "fupgrade upgrade" {
|
|
run upgrade
|
|
[ "${status}" -eq 0 ]
|
|
[ "${lines[0]}" = "Fetching latest changes ..." ]
|
|
}
|