mirror of
https://github.com/kazhala/dotbare
synced 2024-11-17 21:25:32 +00:00
fstat test
This commit is contained in:
parent
d34dc3b6ac
commit
feed88e78b
30
tests/fstat.bats
Executable file
30
tests/fstat.bats
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
help() {
|
||||
bash "${BATS_TEST_DIRNAME}"/../dotbare fstat -h
|
||||
}
|
||||
|
||||
invalid_option() {
|
||||
bash "${BATS_TEST_DIRNAME}"/../dotbare fstat -p
|
||||
}
|
||||
|
||||
no_modify() {
|
||||
bash "${BATS_TEST_DIRNAME}"/../dotbare fstat
|
||||
}
|
||||
|
||||
@test "fstat help" {
|
||||
run help
|
||||
[ "${status}" -eq 0 ]
|
||||
[ "${lines[0]}" = "Usage: dotbare fstat [-h] ..." ]
|
||||
}
|
||||
|
||||
@test "fstat invalid option" {
|
||||
run invalid_option
|
||||
[ "${status}" -eq 1 ]
|
||||
[ "${lines[0]}" = "Invalid option: p" ]
|
||||
}
|
||||
|
||||
@test "fstat run no modify file" {
|
||||
run no_modify
|
||||
[ "${status}" -eq 0 ]
|
||||
}
|
Loading…
Reference in New Issue
Block a user