Improvements to notification formatting and options
This commit is contained in:
parent
7b6d59479a
commit
cac8315195
2 changed files with 26 additions and 10 deletions
|
@ -4,7 +4,9 @@
|
|||
load "../auto-notify.plugin.zsh"
|
||||
|
||||
function notify-send {
|
||||
echo - "Notification: $@"
|
||||
echo - "Notification Title: $1"
|
||||
echo - "Notification Body: $2"
|
||||
echo - "${@:3}"
|
||||
}
|
||||
|
||||
function uname {
|
||||
|
@ -83,8 +85,10 @@
|
|||
run _auto_notify_send
|
||||
|
||||
assert $state equals 0
|
||||
assert "$lines[1]" same_as 'Notification: "f bar -r" has completed'
|
||||
assert "$lines[2]" same_as "(Total time: 20 seconds)"
|
||||
assert "$lines[1]" same_as 'Notification Title: "f bar -r" Completed'
|
||||
assert "$lines[2]" same_as "Notification Body: Total time: 20 seconds"
|
||||
assert "$lines[3]" same_as "Exit code: 0"
|
||||
assert "$lines[4]" same_as "--urgency=normal --expire-time=8000"
|
||||
}
|
||||
|
||||
@test 'auto-notify-send sends notification on MacOSX' {
|
||||
|
@ -97,14 +101,14 @@
|
|||
}
|
||||
|
||||
function osascript {
|
||||
echo - $@
|
||||
echo - "${@}"
|
||||
}
|
||||
|
||||
run _auto_notify_send
|
||||
|
||||
assert $state equals 0
|
||||
assert "$lines[1]" same_as '-e display notification "\"f bar -r\" has completed'
|
||||
assert "$lines[2]" same_as '(Total time: 20 seconds)" with title "Command Completed"'
|
||||
assert "$lines[1]" same_as '-e display notification "Total time: 20 seconds'
|
||||
assert "$lines[2]" same_as 'Exit code: 0" with title "\"f bar -r\" Completed"'
|
||||
}
|
||||
|
||||
@test 'auto-notify-send sends warning on unsupported platform' {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue