diff options
Diffstat (limited to 'tests/test-wttrin-requery-force.el')
| -rw-r--r-- | tests/test-wttrin-requery-force.el | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/tests/test-wttrin-requery-force.el b/tests/test-wttrin-requery-force.el index d572348..30af7dd 100644 --- a/tests/test-wttrin-requery-force.el +++ b/tests/test-wttrin-requery-force.el @@ -35,7 +35,7 @@ (unwind-protect (let ((queried-location nil)) (cl-letf (((symbol-function 'wttrin-query) - (lambda (location) (setq queried-location location)))) + (lambda (location &rest _) (setq queried-location location)))) ;; Set up a weather buffer with a known location (with-current-buffer (get-buffer-create "*wttr.in*") (setq-local wttrin--current-location "Berlin, DE") @@ -49,7 +49,7 @@ (unwind-protect (let ((force-refresh-was-set nil)) (cl-letf (((symbol-function 'wttrin-query) - (lambda (_location) + (lambda (_location &rest _) (setq force-refresh-was-set wttrin--force-refresh)))) (with-current-buffer (get-buffer-create "*wttr.in*") (setq-local wttrin--current-location "Paris") @@ -63,15 +63,12 @@ "When no current location is set, user should be told there's nothing to refresh." (test-wttrin-requery-force-setup) (unwind-protect - (let ((displayed-message nil)) - (cl-letf (((symbol-function 'message) - (lambda (fmt &rest args) - (setq displayed-message (apply #'format fmt args))))) - (with-current-buffer (get-buffer-create "*wttr.in*") - ;; wttrin--current-location is nil (buffer-local default) - (wttrin-requery-force) - (should displayed-message) - (should (string-match-p "No location" displayed-message))))) + (testutil-wttrin-with-captured-message displayed-message + (with-current-buffer (get-buffer-create "*wttr.in*") + ;; wttrin--current-location is nil (buffer-local default) + (wttrin-requery-force) + (should displayed-message) + (should (string-match-p "No location" displayed-message)))) (test-wttrin-requery-force-teardown))) (ert-deftest test-wttrin-requery-force-boundary-force-flag-does-not-leak () @@ -79,7 +76,7 @@ (test-wttrin-requery-force-setup) (unwind-protect (progn - (cl-letf (((symbol-function 'wttrin-query) (lambda (_location) nil))) + (cl-letf (((symbol-function 'wttrin-query) (lambda (_location &rest _) nil))) (with-current-buffer (get-buffer-create "*wttr.in*") (setq-local wttrin--current-location "Paris") (wttrin-requery-force))) |
