funtrack test

pull/3/head
kevin zhuang 4 years ago
parent feed88e78b
commit d09293f9bc

@ -23,7 +23,7 @@ source "${mydir}"/../helper/git_query.sh
source "${mydir}"/../helper/get_confirmation.sh
function usage() {
echo -e "Usage: dotbare funtrack [-h] [-f] [-d] ...\n"
echo -e "Usage: dotbare funtrack [-h] [-s] [-S] ...\n"
echo -e "Untrack selected files from git\n"
echo -e "Note: by default, the untrack will remove the file from index while"
echo -e "keeping the file in your current system (git rm --cached filename)"

@ -0,0 +1,21 @@
#!/usr/bin/env bats
help() {
bash "${BATS_TEST_DIRNAME}"/../dotbare funtrack -h
}
invalid_option() {
bash "${BATS_TEST_DIRNAME}"/../dotbare funtrack -p
}
@test "funtrack help" {
run help
[ "${status}" -eq 0 ]
[ "${lines[0]}" = "Usage: dotbare funtrack [-h] [-s] [-S] ..." ]
}
@test "funtrack invalid option" {
run invalid_option
[ "${status}" -eq 1 ]
[ "${lines[0]}" = "Invalid option: p" ]
}
Loading…
Cancel
Save