branch: elpa/pacmacs
commit 1e4d6cd8b7cb885cacfb2e318db2992426031428
Author: rexim <[email protected]>
Commit: rexim <[email protected]>
UT for terrified-ghost function (#171)
---
test/pacmacs-test.el | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/test/pacmacs-test.el b/test/pacmacs-test.el
index 78a5a2f81b..dd40d74ca8 100644
--- a/test/pacmacs-test.el
+++ b/test/pacmacs-test.el
@@ -65,3 +65,21 @@
(mock (pacmacs--load-current-level) => nil)
(pacmacs--load-next-level)
(should (= 0 pacmacs-current-level)))))
+
+(ert-deftest pacmacs--terrify-ghost-test ()
+ (let* ((pacmacs--ghost-terrified-time-ms 60065)
+ (ghost (list :property-1 1
+ :property-2 2
+ :current-animation 'ghost-animation
+ :switch-direction-callback 'ghost-direction-switcher
+ :type 'ghost))
+ (terrified-ghost (list :property-1 1
+ :property-2 2
+ :current-animation 'terrified-ghost-animation
+ :switch-direction-callback
'pacmacs--switch-direction-callback
+ :type 'terrified-ghost
+ :terrified-timer
pacmacs--ghost-terrified-time-ms)))
+ (with-mock
+ (mock (pacmacs-load-anim "Terrified-Ghost") => 'terrified-ghost-animation)
+ (should (equal terrified-ghost
+ (pacmacs--terrify-ghost ghost))))))