summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOla Nilsson <ola.nilsson@gmail.com>2019-12-26 22:31:03 +0100
committerOla Nilsson <ola.nilsson@gmail.com>2020-02-29 07:20:37 +0100
commit1fd0d8b7fd7aa00d487b12b56410b2b4c72680aa (patch)
treed3206af1f295639c5213b78e588ea541b6d1165a
parent8e29f4cfb03ca52cd43eaa6bf6313f5a795dcb39 (diff)
Set state pending for skipped specs for correct initial count
By setting the status field to pending, the initial count printed by the reporter will be correct.
-rw-r--r--buttercup.el3
-rw-r--r--tests/test-buttercup.el7
2 files changed, 8 insertions, 2 deletions
diff --git a/buttercup.el b/buttercup.el
index 092deef..6832e4a 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1380,7 +1380,8 @@ SUITES is a list of suites. PATTERNS is a list of regexps."
(when (string-match p spec-full-name)
(cl-return t)))
(setf (buttercup-spec-function spec)
- (lambda () (signal 'buttercup-pending "SKIPPED")))))))
+ (lambda () (signal 'buttercup-pending "SKIPPED"))
+ (buttercup-spec-status spec) 'pending)))))
;;;###autoload
(defun buttercup-run-markdown-buffer (&rest markdown-buffers)
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 8d88aa8..58a9123 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -267,7 +267,12 @@
(it "should return the number of pending specs in a list of suites"
(with-local-buttercup
(expect (buttercup-suites-total-specs-pending suites)
- :to-equal 2))))
+ :to-equal 2)))
+ (it "should also count skipped specs"
+ (with-local-buttercup
+ (buttercup--mark-skipped suites (list "skipped"))
+ (expect (buttercup-suites-total-specs-pending suites)
+ :to-equal 3))))
(describe "The `buttercup-suites-total-specs-failed' function"
(it "should return the number of failed specs in a list of suites"