diff options
-rw-r--r-- | tests/piem-rmail-tests.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/piem-rmail-tests.el b/tests/piem-rmail-tests.el index a9b397b..f56e2f2 100644 --- a/tests/piem-rmail-tests.el +++ b/tests/piem-rmail-tests.el @@ -47,12 +47,16 @@ References: <123@example.com> no thanks ") +(defun piem-rmail-tests-rmail-mode () + (cl-letf (((symbol-function #'message) (lambda (&rest _)))) + (rmail-mode))) + (ert-deftest piem-rmail-get-inbox () (should (equal "foo" (with-temp-buffer (insert piem-rmail-tests-mbox-text) - (rmail-mode) + (piem-rmail-tests-rmail-mode) (let ((piem-get-inboxes-from-config nil) (piem-inboxes '(("foo" :address "i@inbox.example.com")))) (piem-rmail-get-inbox)))))) @@ -62,7 +66,7 @@ no thanks (equal (list "123@example.com" "456@example.com") (with-temp-buffer (insert piem-rmail-tests-mbox-text) - (rmail-mode) + (piem-rmail-tests-rmail-mode) (rmail-first-message) (let ((piem-get-inboxes-from-config nil) (piem-inboxes '(("foo" :address "i@inbox.example.com")))) |