2020-05-19 10:50:34 +00:00
|
|
|
#!/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 ]
|
2020-06-27 23:33:17 +00:00
|
|
|
[ "${lines[0]}" = "Invalid option: -p" ]
|
2020-05-19 10:50:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "fupgrade upgrade" {
|
2020-06-28 00:38:55 +00:00
|
|
|
skip
|
2020-05-19 10:50:34 +00:00
|
|
|
run upgrade
|
|
|
|
[ "${status}" -eq 0 ]
|
2020-06-27 23:33:17 +00:00
|
|
|
[ "${lines[0]}" = "Updating dotbare ..." ]
|
2020-05-19 10:50:34 +00:00
|
|
|
}
|