Format + add tests
This commit is contained in:
parent
46bae9c02a
commit
9dc90567e3
2 changed files with 15 additions and 1 deletions
|
@ -9,7 +9,9 @@ AUTO_COMMAND_START=0
|
||||||
# Threshold for when to automatically show a notification
|
# Threshold for when to automatically show a notification
|
||||||
export AUTO_NOTIFY_THRESHOLD=5
|
export AUTO_NOTIFY_THRESHOLD=5
|
||||||
# List of commands/programs to ignore sending notifications for
|
# List of commands/programs to ignore sending notifications for
|
||||||
export AUTO_NOTIFY_IGNORE=("vim" "nvim" "emacs" "less" "more" "man" "tig" "watch")
|
export AUTO_NOTIFY_IGNORE=(
|
||||||
|
"vim" "nvim" "emacs" "less" "more" "man" "tig" "watch" "git commit"
|
||||||
|
)
|
||||||
|
|
||||||
autoload -Uz add-zsh-hook
|
autoload -Uz add-zsh-hook
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@test 'auto-notify-send does not send notification for ignored commands' {
|
@test 'auto-notify-send does not send notification for ignored commands' {
|
||||||
|
for command in $AUTO_NOTIFY_IGNORE; do
|
||||||
|
AUTO_COMMAND="somealias"
|
||||||
|
AUTO_COMMAND_FULL="$command"
|
||||||
|
AUTO_COMMAND_START=11000
|
||||||
|
run _auto_notify_send
|
||||||
|
|
||||||
|
assert $state equals 0
|
||||||
|
assert "$output" is_empty
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
@test 'auto-notify-send does not send notification for ignored commands with arguments' {
|
||||||
for command in $AUTO_NOTIFY_IGNORE; do
|
for command in $AUTO_NOTIFY_IGNORE; do
|
||||||
AUTO_COMMAND="somealias bar -r"
|
AUTO_COMMAND="somealias bar -r"
|
||||||
AUTO_COMMAND_FULL="$command bar -r"
|
AUTO_COMMAND_FULL="$command bar -r"
|
||||||
|
|
Loading…
Add table
Reference in a new issue