2
0
mirror of https://github.com/kazhala/dotbare synced 2024-11-17 21:25:32 +00:00
dotbare/tests/fupgrade.bats
kevin zhuang 542bc0838c docs(changlog): update new changes
fix: test

..

test: improve wording and variable names in test

..

..
2020-06-28 14:16:24 +10:00

33 lines
589 B
Bash
Executable File

#!/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" {
skip
run upgrade
[ "${status}" -eq 0 ]
[ "${lines[0]}" = "Updating dotbare ..." ]
}