We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e1d506 commit 9d1b52fCopy full SHA for 9d1b52f
test/test-open.bats
@@ -6,6 +6,7 @@ load 'helpers'
6
7
function open() { echo "Opening $*"; }
8
export -f open
9
+
10
function edit() { echo "Editing $*"; }
11
export -f edit
12
export EDITOR="edit"
@@ -80,4 +81,16 @@ notes="./notes"
80
81
82
assert_success
83
assert_output "Editing $NOTES_DIRECTORY/note.md"
84
+}
85
86
+@test "Uses 'editor' if $EDITOR is not available" {
87
+ unset EDITOR
88
+ # Simulate a `editor` symlink (as in Debian/Ubuntu/etc)
89
+ function editor() { echo "Editor bin, editing $*"; }
90
+ export -f editor
91
92
+ run bash -c "$notes open note.md"
93
94
+ assert_success
95
+ assert_output "Editor bin, editing $NOTES_DIRECTORY/note.md"
96
}
0 commit comments