File tree Expand file tree Collapse file tree 4 files changed +33
-0
lines changed
Expand file tree Collapse file tree 4 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,14 @@ notes="./notes"
3232 assert_line " note2.md"
3333}
3434
35+ @test " Should find notes when using the find shorthand alias" {
36+ touch $NOTES_DIRECTORY /note.md
37+
38+ run $notes f
39+ assert_success
40+ assert_line " note.md"
41+ }
42+
3543@test " Should show matching notes only if a pattern is provided to find" {
3644 touch $NOTES_DIRECTORY /match-note1.md
3745 touch $NOTES_DIRECTORY /hide-note2.md
Original file line number Diff line number Diff line change @@ -32,6 +32,15 @@ notes="./notes"
3232 refute_line " non-matching-note.md"
3333}
3434
35+ @test " Should grep notes when using the grep shorthand alias" {
36+ echo " my-pattern" > $NOTES_DIRECTORY /matching-note.md
37+
38+ run $notes g my-pattern
39+
40+ assert_success
41+ assert_line " matching-note.md"
42+ }
43+
3544@test " Should grep case-insensitively" {
3645 echo " LETTERS" > $NOTES_DIRECTORY /matching-note.md
3746
Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ notes="./notes"
2222 assert_exists " $NOTES_DIRECTORY /note.md"
2323}
2424
25+ @test " Should create new notes when using the shorthand alias" {
26+ run $notes n note
27+
28+ assert_success
29+ assert_exists " $NOTES_DIRECTORY /note.md"
30+ }
31+
2532@test " Should create new notes within subfolders" {
2633 run $notes new subfolder/note
2734
Original file line number Diff line number Diff line change @@ -54,6 +54,15 @@ notes="./notes"
5454 assert_output " Editing $NOTES_DIRECTORY /note.md"
5555}
5656
57+ @test " Opens a file passed by pipe when using the shorthand open alias" {
58+ touch $NOTES_DIRECTORY /note.md
59+
60+ run bash -c " $notes find | $notes o"
61+
62+ assert_success
63+ assert_output " Editing $NOTES_DIRECTORY /note.md"
64+ }
65+
5766@test " Opens multiple files passed by pipe from find" {
5867 touch $NOTES_DIRECTORY /note.md
5968 touch $NOTES_DIRECTORY /note2.md
You can’t perform that action at this time.
0 commit comments