File tree 4 files changed +33
-0
lines changed 4 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,14 @@ notes="./notes"
32
32
assert_line " note2.md"
33
33
}
34
34
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
+
35
43
@test " Should show matching notes only if a pattern is provided to find" {
36
44
touch $NOTES_DIRECTORY /match-note1.md
37
45
touch $NOTES_DIRECTORY /hide-note2.md
Original file line number Diff line number Diff line change @@ -32,6 +32,15 @@ notes="./notes"
32
32
refute_line " non-matching-note.md"
33
33
}
34
34
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
+
35
44
@test " Should grep case-insensitively" {
36
45
echo " LETTERS" > $NOTES_DIRECTORY /matching-note.md
37
46
Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ notes="./notes"
22
22
assert_exists " $NOTES_DIRECTORY /note.md"
23
23
}
24
24
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
+
25
32
@test " Should create new notes within subfolders" {
26
33
run $notes new subfolder/note
27
34
Original file line number Diff line number Diff line change @@ -54,6 +54,15 @@ notes="./notes"
54
54
assert_output " Editing $NOTES_DIRECTORY /note.md"
55
55
}
56
56
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
+
57
66
@test " Opens multiple files passed by pipe from find" {
58
67
touch $NOTES_DIRECTORY /note.md
59
68
touch $NOTES_DIRECTORY /note2.md
You can’t perform that action at this time.
0 commit comments