2020-05-13 03:41:58 +00:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
help() {
|
|
|
|
bash "${BATS_TEST_DIRNAME}"/../dotbare fstash -h
|
|
|
|
}
|
|
|
|
|
|
|
|
invalid_option() {
|
|
|
|
bash "${BATS_TEST_DIRNAME}"/../dotbare fstash -w
|
|
|
|
}
|
|
|
|
|
|
|
|
stash_file() {
|
2020-06-25 03:08:24 +00:00
|
|
|
bash "${BATS_TEST_DIRNAME}"/../dotbare fstash -s
|
2020-05-13 03:41:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "fstash help" {
|
|
|
|
run help
|
|
|
|
[ "${status}" -eq 0 ]
|
2020-06-25 03:08:24 +00:00
|
|
|
[ "${lines[0]}" = "Usage: dotbare fstash [-h] [-s] [-d] [-p] ..." ]
|
2020-05-13 03:41:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "fstash invalid option" {
|
|
|
|
run invalid_option
|
|
|
|
[ "${status}" -eq 1 ]
|
2020-06-25 03:08:24 +00:00
|
|
|
[ "${lines[0]}" = "Invalid option: -w" ]
|
2020-05-13 03:41:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "fstash stash single file" {
|
|
|
|
run stash_file
|
|
|
|
[ "${status}" -eq 1 ]
|
|
|
|
}
|