Implement "search" command
This commit is contained in:
parent
542095a49b
commit
c0bd1e11fc
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
setup() {
|
||||
source ../zk
|
||||
}
|
||||
|
||||
test__zk_search_calls__zk_list() {
|
||||
expected="_zk_list"
|
||||
fake _zk_list echo "$expected"
|
||||
fake fzf cat
|
||||
|
||||
result="$(_zk_search)"
|
||||
|
||||
assert_equals "$expected" "$result"
|
||||
}
|
||||
|
||||
test__zk_search_extracts_id_from_chosen_zettel() {
|
||||
expected="1111111111111"
|
||||
# shellcheck disable=SC2016
|
||||
fake _zk_list 'echo "$expected | Zettel Title"'
|
||||
fake fzf cat
|
||||
|
||||
result="$(_zk_search)"
|
||||
|
||||
assert_equals "$expected" "$result"
|
||||
}
|
Loading…
Reference in New Issue