File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -42,3 +42,21 @@ notes="./notes"
4242 assert_success
4343 assert_exists " $NOTES_DIRECTORY /test.txt"
4444}
45+
46+ @test " Configuration should be accepted if NOTES_DIR doesn't exist" {
47+ mkdir -p $HOME /.config/notes
48+ echo " NOTES_DIRECTORY=$NOTES_DIRECTORY /notesdir" > $HOME /.config/notes/config
49+ run $notes new test
50+
51+ assert_success
52+ }
53+
54+ @test " Configuration should be rejected if NOTES_DIR is a existing file" {
55+ mkdir -p $HOME /.config/notes
56+ touch $NOTES_DIRECTORY /testfile
57+ echo " NOTES_DIRECTORY=$NOTES_DIRECTORY /testfile" > $HOME /.config/notes/config
58+ run $notes new test
59+
60+ assert_failure
61+ assert_line " Could not create directory $NOTES_DIRECTORY /testfile, please update your \$ NOTES_DIRECTORY"
62+ }
You can’t perform that action at this time.
0 commit comments