28 lines
744 B
Text
28 lines
744 B
Text
#!/usr/bin/env zunit
|
|
|
|
@setup {
|
|
load "../auto-notify.plugin.zsh"
|
|
}
|
|
|
|
@test 'version exported' {
|
|
git_version="$(git tag --list | sort -V | tail -1)"
|
|
git tag --list
|
|
|
|
assert "$AUTO_NOTIFY_VERSION" is_not_empty
|
|
assert "$AUTO_NOTIFY_VERSION" same_as "$git_version"
|
|
}
|
|
|
|
@test 'hook functions are loaded by default' {
|
|
assert '_auto_notify_track' in $preexec_functions
|
|
assert '_auto_notify_send' in $precmd_functions
|
|
}
|
|
|
|
@test 'enable/disable auto-notify' {
|
|
disable_auto_notify
|
|
assert '_auto_notify_track' not_in $preexec_functions
|
|
assert '_auto_notify_send' not_in $precmd_functions
|
|
|
|
enable_auto_notify
|
|
assert '_auto_notify_track' in $preexec_functions
|
|
assert '_auto_notify_send' in $precmd_functions
|
|
}
|