File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -57,4 +57,24 @@ notes="./notes"
57
57
58
58
assert_failure
59
59
assert_line " Could not create directory $NOTES_DIRECTORY /testfile, please update your \$ NOTES_DIRECTORY"
60
- }
60
+ }
61
+
62
+ @test " Post-command should run if it is a modification command" {
63
+ mkdir -p $HOME /.config/notes
64
+ echo ' POST_COMMAND="echo 1 > $HOME/post-output"' > $HOME /.config/notes/config
65
+ run $notes new test
66
+
67
+ assert_success
68
+ assert_exists $HOME /post-output
69
+ }
70
+
71
+ @test " Post-command should not run if it is not a modification command" {
72
+ run $notes new test
73
+
74
+ mkdir -p $HOME /.config/notes
75
+ echo ' POST_COMMAND="echo 1 > $HOME/post-output"' > $HOME /.config/notes/config
76
+ run $notes cat test
77
+
78
+ assert_success
79
+ refute_exists $HOME /post-output
80
+ }
You can’t perform that action at this time.
0 commit comments