mirror of
https://github.com/kazhala/dotbare
synced 2024-11-08 07:10:24 +00:00
32 lines
576 B
Bash
Executable File
32 lines
576 B
Bash
Executable File
#!/usr/bin/env bats
|
|
|
|
help() {
|
|
bash "${BATS_TEST_DIRNAME}"/../dotbare fadd -h
|
|
}
|
|
|
|
invalid_option() {
|
|
bash "${BATS_TEST_DIRNAME}"/../dotbare fadd -p
|
|
}
|
|
|
|
no_file_selected() {
|
|
cd "${BATS_TEST_DIRNAME}"
|
|
bash "${BATS_TEST_DIRNAME}"/../dotbare fadd -d
|
|
}
|
|
|
|
@test "fadd help" {
|
|
run help
|
|
[ "${status}" -eq 0 ]
|
|
[ "${lines[0]}" = "Usage: dotbare fadd [-h] [-f] [-d] ..." ]
|
|
}
|
|
|
|
@test "fadd invalid option" {
|
|
run invalid_option
|
|
[ "${status}" -eq 1 ]
|
|
[ "${lines[0]}" = "Invalid option: p" ]
|
|
}
|
|
|
|
@test "fadd no file selected" {
|
|
run no_file_selected
|
|
[ "${status}" -eq 1 ]
|
|
}
|