aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-20 23:31:58 -0500
committerCraig Jennings <c@cjennings.net>2026-07-20 23:31:58 -0500
commit019057c7902ca0286b2ae9f0148f29bc53487dcd (patch)
treedb6ceb7ca1788240e97d8809607a93154519fc8b /tests
parent2f2d8b1c4f4eae6707c472b2287c72c3bb796309 (diff)
downloaddotemacs-019057c7902ca0286b2ae9f0148f29bc53487dcd.tar.gz
dotemacs-019057c7902ca0286b2ae9f0148f29bc53487dcd.zip
fix(slack): friendly error on reaction command before slack loads
slack-current-buffer is declared but void until slack.el loads, so a cold C-; S ! signaled void-variable instead of the not-in-a-Slack-buffer message.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-slack-config-reactions.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test-slack-config-reactions.el b/tests/test-slack-config-reactions.el
index 491b8147..bfcf3e29 100644
--- a/tests/test-slack-config-reactions.el
+++ b/tests/test-slack-config-reactions.el
@@ -92,5 +92,13 @@
(let ((slack-current-buffer nil))
(should-error (cj/slack-message-add-reaction) :type 'user-error)))
+(ert-deftest test-slack-config-message-add-reaction-errors-before-slack-loads ()
+ "Error: a cold call before slack.el ever loads gives the friendly user-error.
+The module defvars slack-current-buffer with no value, so until slack.el
+binds it the variable is void -- a bare read signals void-variable instead
+of the intended \"Not in a Slack buffer\"."
+ (makunbound 'slack-current-buffer)
+ (should-error (cj/slack-message-add-reaction) :type 'user-error))
+
(provide 'test-slack-config-reactions)
;;; test-slack-config-reactions.el ends here