Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B70C4429E2E for ; Wed, 21 Dec 2011 10:19:13 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QaNb0pubgQEJ for ; Wed, 21 Dec 2011 10:19:13 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D3E5B431FD0 for ; Wed, 21 Dec 2011 10:19:12 -0800 (PST) Received: by mail-ww0-f45.google.com with SMTP id ds13so11998557wgb.2 for ; Wed, 21 Dec 2011 10:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=nFfJ1ZGMCBkByzPRDuYANmlKoPCkhn4CdmlBD3qhQQs=; b=mU+1Zqpz+Y29AXX5+r8Z+q2AWB+xh67KVKz/4LQ1kik1iAjf9UFhXy/gD9wTfW9SVp ffkqSdv51oiiHAtJKzXaMnYaNRw1K31LpbBO6naQaHtKw3bxv432hmKOal27EX52czAb NPPVHJ4e/2sKKhgjwE8LNCEBBtAmDwABKEB68= Received: by 10.227.208.134 with SMTP id gc6mr7315998wbb.3.1324491552438; Wed, 21 Dec 2011 10:19:12 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id en20sm15465622wid.10.2011.12.21.10.19.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Dec 2011 10:19:12 -0800 (PST) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH 2/2] test: add test for `notmuch-hello-refresh-hook' Date: Wed, 21 Dec 2011 22:18:26 +0400 Message-Id: <1324491506-1134-2-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1324491506-1134-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1324491506-1134-1-git-send-email-dmitry.kurochkin@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 18:19:14 -0000 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'. --- test/emacs | 19 +++++++++++++++++++ test/test-lib.el | 1 + 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/test/emacs b/test/emacs index dffad0f..ca82445 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 83b8a65..3b817c3 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) -- 1.7.7.3