From: Dmitry Kurochkin Date: Wed, 21 Dec 2011 18:18:26 +0000 (+0400) Subject: test: add test for `notmuch-hello-refresh-hook' X-Git-Tag: 0.11_rc1~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9a0b61da56ede4d0ff79a064d92d8c1a16cf636b;p=notmuch.git test: add test for `notmuch-hello-refresh-hook' Test that `notmuch-hello-refresh-hook' is called once when `notmuch-hello' is called and twice when calling `notmuch-hello-update' after that. The tests are very similar to tests for `notmuch-hello-mode-hook'. --- diff --git a/test/emacs b/test/emacs index dffad0fc..ca824453 100755 --- a/test/emacs +++ b/test/emacs @@ -495,4 +495,23 @@ counter=$(test_emacs \ ) test_expect_equal "$counter" 1 +test_begin_subtest "notmuch-hello-refresh hook is called" +counter=$(test_emacs \ + '(let ((notmuch-hello-refresh-hook-counter 0)) + (kill-buffer "*notmuch-hello*") + (notmuch-hello) + notmuch-hello-refresh-hook-counter)' +) +test_expect_equal "$counter" 1 + +test_begin_subtest "notmuch-hello-refresh hook is called on updates" +counter=$(test_emacs \ + '(let ((notmuch-hello-refresh-hook-counter 0)) + (kill-buffer "*notmuch-hello*") + (notmuch-hello) + (notmuch-hello-update) + notmuch-hello-refresh-hook-counter)' +) +test_expect_equal "$counter" 2 + test_done diff --git a/test/test-lib.el b/test/test-lib.el index 83b8a651..3b817c37 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -75,3 +75,4 @@ nothing." (add-hook hook (apply-partially 'hook-counter hook))) (add-hook-counter 'notmuch-hello-mode-hook) +(add-hook-counter 'notmuch-hello-refresh-hook)