Rename main test file to test_plugin.zunit

This commit is contained in:
Michael Aquilina 2019-07-20 21:34:17 +01:00
parent e25849a979
commit 7b6d59479a
No known key found for this signature in database
GPG key ID: 636066730B056BD1
2 changed files with 1 additions and 2 deletions

28
tests/test_plugin.zunit Normal file
View file

@ -0,0 +1,28 @@
#!/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
}