-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from cybercoder-naj/feat/add-realpath-command
New command: `realpath`
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!./test/libs/bats/bin/bats | ||
|
||
load 'helpers' | ||
|
||
setup() { | ||
setupNotesEnv | ||
} | ||
|
||
teardown() { | ||
teardownNotesEnv | ||
} | ||
|
||
export EDITOR=touch | ||
notes="./notes" | ||
|
||
@test "realpath should return notes_dir without a filename" { | ||
run $notes realpath | ||
|
||
assert_success | ||
assert_output "$NOTES_DIRECTORY" | ||
} | ||
|
||
@test "realpath of non-existing notes should return the future path to the file" { | ||
run $notes realpath note | ||
|
||
assert_success | ||
assert_output "$NOTES_DIRECTORY/note.md" | ||
} | ||
|
||
@test "realpath of any existing note should return the path to the file" { | ||
run $notes new note | ||
run $notes realpath note | ||
|
||
assert_success | ||
assert_output "$NOTES_DIRECTORY/note.md" | ||
} |