From d78900f06615e247cee5472beca4e7ae164fe77f Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 30 Apr 2023 18:09:03 -0400 Subject: piem-rmail-tests.el: Silence rmail-mode messages Avoid polluting the test output with Counting messages... Counting messages...done --- tests/piem-rmail-tests.el | 8 ++++++-- 1 file 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")))) -- cgit v1.2.3