branch: elpa/buttercup commit 2040757c3c55a2c2abfdd517b2360cd9ced456c2 Author: Ola Nilsson <ola.nils...@gmail.com> Commit: Ola Nilsson <ola.nils...@gmail.com>
test: Add reporter test for buttercup-started with pending specs --- tests/test-buttercup.el | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el index c2d6c0b..66061b6 100644 --- a/tests/test-buttercup.el +++ b/tests/test-buttercup.el @@ -1088,11 +1088,24 @@ text properties using `ansi-color-apply'." (setq print-buffer nil)) (describe "on the buttercup-started event" + :var (skipped + ;; Local var for testing. The real variable is used by the + ;; reporter attached to the buttercup instance running + ;; these tests. + buttercup-reporter-batch--start-time) + (before-each + (setq skipped (make-buttercup-spec :description "skipped" :status 'pending))) + (it "should print the number of specs" - (let ((buttercup-reporter-batch--start-time nil) - (buttercup-reporter-batch--failures nil)) + (let ((buttercup-reporter-batch--failures nil)) + (buttercup-reporter-batch 'buttercup-started (list parent-suite))) + (expect (buttercup-output) :to-equal "Running 1 specs.\n\n")) + + (it "should print the number of skipped specs" + (let ((buttercup-reporter-batch--failures nil)) + (buttercup-suite-add-child child-suite skipped) (buttercup-reporter-batch 'buttercup-started (list parent-suite))) - (expect (buttercup-output) :to-equal "Running 1 specs.\n\n"))) + (expect (buttercup-output) :to-equal "Running 1 out of 2 specs.\n\n"))) (describe "on the suite-started event" (it "should emit an indented suite description"