diff --git a/tests/fadd.bats b/tests/fadd.bats index b046904..7074862 100755 --- a/tests/fadd.bats +++ b/tests/fadd.bats @@ -19,7 +19,7 @@ no_file_selected() { [ "${lines[0]}" = "Usage: dotbare fadd [-h] [-f] [-d] ..." ] } -@test "fadd nofile stage" { +@test "fadd invalid option" { run invalid_option [ "${status}" -eq 1 ] [ "${lines[0]}" = "Invalid option: p" ] diff --git a/tests/fcheckout.bats b/tests/fcheckout.bats new file mode 100755 index 0000000..1cb89f2 --- /dev/null +++ b/tests/fcheckout.bats @@ -0,0 +1,21 @@ +#!/usr/bin/env bats + +help() { + bash "${BATS_TEST_DIRNAME}"/../dotbare fcheckout -h +} + +invalid_option() { + bash "${BATS_TEST_DIRNAME}"/../dotbare fcheckout -p +} + +@test "fcheckout help" { + run help + [ "${status}" -eq 0 ] + [ "${lines[0]}" = "Usage: dotbare fcheckout [-h] [-a] [-b] [-c] ..." ] +} + +@test "fchekcout invalid option" { + run invalid_option + [ "${status}" -eq 1 ] + [ "${lines[0]}" = "Invalid option: p" ] +}