[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup 521b71b 253/340: Add tests to ensure pending spe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup 521b71b 253/340: Add tests to ensure pending spec state is not overwritten |
Date: |
Thu, 16 Dec 2021 14:59:45 -0500 (EST) |
branch: elpa/buttercup
commit 521b71bc5814a185888a13b13ca2ba96cd740161
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>
Add tests to ensure pending spec state is not overwritten
Any pending spec in an active suite with at least one after-each
function will be marked as passed when buttercup--update-with-funcall
runs the after-each functions. This is an unintended consequence of
0d742b00debd59f07320638c505777f6a908f5ad.
---
tests/test-buttercup.el | 50 +++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 44 insertions(+), 6 deletions(-)
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index aa3cd95..843a5ea 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -366,7 +366,46 @@
:not :to-be nil)
(expect 'buttercup--set-end-time :to-have-been-called-times 1)
(expect (buttercup-suite-or-spec-time-ended spec)
- :not :to-be nil)))))
+ :not :to-be nil))))
+
+ (it "should not overwrite pending status with `after-each' results"
+ (with-local-buttercup
+ (let ((suite (make-buttercup-suite))
+ spec)
+ (let ((buttercup--current-suite suite))
+ (after-each (ignore))
+ (setq spec (xit "pending")))
+ (buttercup--run-suite suite)
+ (expect (buttercup-spec-status spec) :to-be 'pending))))
+
+ (describe "should set status to pending"
+ (it "for assume in `before-each'"
+ (with-local-buttercup
+ (describe "suite"
+ (before-each (assume nil "assume nil in before-each"))
+ (it "spec" (expect 1 :to-equal 1))
+ (after-each (ignore)))
+ (buttercup-run)
+ (expect (buttercup-suites-total-specs-pending buttercup-suites)
+ :to-equal 1)))
+ (it "for assume in spec"
+ (with-local-buttercup
+ (describe "suite"
+ (before-each (ignore))
+ (it "spec" (assume nil "assume nil in spec"))
+ (after-each (ignore)))
+ (buttercup-run)
+ (expect (buttercup-suites-total-specs-pending buttercup-suites)
+ :to-equal 1)))
+ (it "for assume in `after-each'"
+ (with-local-buttercup
+ (describe "suite"
+ (before-each (ignore))
+ (it "spec" (expect 1 :to-equal 1))
+ (after-each (assume nil "assume nil in after-each")))
+ (buttercup-run)
+ (expect (buttercup-suites-total-specs-pending buttercup-suites)
+ :to-equal 1)))))
;;;;;;;;;;;;;;;;;;;;
;;; Suites: describe
@@ -605,12 +644,11 @@
:to-be 'pending)))
(it "should set the failure description to PENDING"
- (let ((buttercup--current-suite (make-buttercup-suite))
- spec)
- (buttercup-xit "bla bla")
- (setq spec (car (buttercup-suite-children buttercup--current-suite)))
+ (let* ((buttercup--current-suite (make-buttercup-suite))
+ (spec (buttercup-xit "bla bla")))
(buttercup--update-with-funcall spec (buttercup-spec-function spec))
- (expect (buttercup-suite-or-spec-failure-description spec) :to-equal
"PENDING"))))
+ (expect (buttercup-suite-or-spec-failure-description spec) :to-equal
"PENDING")
+ (expect (buttercup-suite-or-spec-status spec) :to-equal 'pending))))
;;;;;;;;;
;;; Spies
- [nongnu] elpa/buttercup 8e29f4c 259/340: Extract buttercup--mark-skipped from buttercup-run-discover, (continued)
- [nongnu] elpa/buttercup 8e29f4c 259/340: Extract buttercup--mark-skipped from buttercup-run-discover, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 669ca99 267/340: test: Split make rule test into test-buttercup and test-docs, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6655f77 269/340: Update test run duration output in buttercup-reporter-batch, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 0e6c09e 271/340: Correct the assume docstring, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6848057 167/340: Bump version: 1.9 → 1.10, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 8628d45 208/340: Merge pull request #147 from snogge/suite-local-function, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a6f2486 211/340: Merge pull request #150 from DarwinAwardWinner/suppress-warning-redirect, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a019f7a 221/340: Use spy-calls-count as appropriate, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b297b1d 241/340: Revert "Change: (buttercup-define-matcher-for-binary-function) Add newlines", ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 7903e1a 250/340: Revert "Make it possible to abort test run cleanly", ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 521b71b 253/340: Add tests to ensure pending spec state is not overwritten,
ELPA Syncer <=
- [nongnu] elpa/buttercup 9265f83 258/340: Add test for buttercup-suites-total-specs-pending, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b360e35 264/340: test: Add tests for buttercup--mark-skipped, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 9b94921 276/340: test: Add tests for buttercup-reporter-batch buttercup-done handling, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 2040757 277/340: test: Add reporter test for buttercup-started with pending specs, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a91f282 283/340: Handle multiline spec descriptions in buttercup-reporter-batch-color, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 532d082 284/340: test: Fix tab stops in send-string-to-ansi-buffer for Emacs 24.3, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 8afc407 286/340: Switch from to pcase for spec-done in buttercup-reporter-batch-color, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d5c3ed5 289/340: Switch to Github Actions, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 41424d5 292/340: Add new public function buttercup-mark-skipped, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5752a57 295/340: Control errors from buttercup-run with noerror argument, ELPA Syncer, 2021/12/16