Add "edit" command
This commit is contained in:
parent
c0bd1e11fc
commit
d2405b8b3b
|
@ -31,6 +31,15 @@ test_get_command_returns_new_for_substring() {
|
|||
done
|
||||
}
|
||||
|
||||
test_get_command_returns_edit_for_substring() {
|
||||
expected="edit"
|
||||
|
||||
for arg in e ed edi edit; do
|
||||
result="$(get_command "$ZKCOMMANDS" "$arg")"
|
||||
assert_equals "$expected" "$result"
|
||||
done
|
||||
}
|
||||
|
||||
test_get_command_does_not_return_match_unless_at_start_of_command_string() {
|
||||
commands="delete"
|
||||
expected=""
|
||||
|
|
|
@ -34,3 +34,12 @@ test_main_calls_new_when_new_command_passed() {
|
|||
assert_equals "$expected" "$result"
|
||||
}
|
||||
|
||||
test_main_calls_edit_when_edit_command_passed() {
|
||||
expected="_zk_edit"
|
||||
fake get_command 'echo edit'
|
||||
fake _zk_edit "echo $expected"
|
||||
|
||||
result="$(main)"
|
||||
|
||||
assert_equals "$expected" "$result"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue