zk/tests/test_main.sh

26 lines
422 B
Bash
Raw Normal View History

2023-12-08 16:08:34 +00:00
#!/bin/bash
setup() {
source ../zk
}
test_main_calls_new_when_new_command_passed() {
expected="_zk_new"
fake get_commands 'echo new'
fake _zk_new "echo $expected"
result="$(main)"
assert_equals "$expected" "$result"
}
test_main_calls_list_when_list_command_passed() {
expected="_zk_list"
fake get_commands 'echo list'
fake _zk_list "echo $expected"
result="$(main)"
assert_equals "$expected" "$result"
}