[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup 0d742b0 187/340: Set failure-description for pen
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup 0d742b0 187/340: Set failure-description for pending specs |
Date: |
Thu, 16 Dec 2021 14:59:31 -0500 (EST) |
branch: elpa/buttercup
commit 0d742b00debd59f07320638c505777f6a908f5ad
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Jorgen Schäfer <Jorgen.Schaefer@gmail.com>
Set failure-description for pending specs
The status slot in buttercup-suite-or-spec is set ahead of time for
pending (not skipped) specs. This meant that the failure-description
and failure-stack of pending specs were never set in
buttercup--update-with-funcall. This in turn meant that the output of
pending specs was
a pending spec
rather than
a pending spec PENDING
which it should have been.
The failure-stack will still always be nil for pending specs.
---
buttercup.el | 7 +++++--
tests/test-buttercup.el | 19 ++++++++++++++++++-
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index a2acab2..2a392cc 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1394,6 +1394,9 @@ Do not change the global value.")
(kill-buffer buttercup-warning-buffer-name))))
(defun buttercup--update-with-funcall (suite-or-spec function &rest args)
+ "Update SUITE-OR-SPEC with the result of calling FUNCTION with ARGS.
+Sets the `status', `failure-description', and `failure-stack' for
+failed and pending specs."
(let* ((result (apply 'buttercup--funcall function args))
(status (elt result 0))
(description (elt result 1))
@@ -1405,8 +1408,8 @@ Do not change the global value.")
(`(error (buttercup-pending . ,pending-description))
(setq status 'pending
description pending-description))))
- (when (eq (buttercup-suite-or-spec-status suite-or-spec)
- 'passed)
+ (when (memq (buttercup-suite-or-spec-status suite-or-spec)
+ '(passed pending))
(setf (buttercup-suite-or-spec-status suite-or-spec) status
(buttercup-suite-or-spec-failure-description suite-or-spec)
description
(buttercup-suite-or-spec-failure-stack suite-or-spec) stack))))
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index d7ff1d9..c32a384 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -530,7 +530,15 @@
(expect (buttercup-spec-status
(car (last (buttercup-suite-children
buttercup--current-suite))))
- :to-be 'pending))))
+ :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)))
+ (buttercup--update-with-funcall spec (buttercup-spec-function spec))
+ (expect (buttercup-suite-or-spec-failure-description spec) :to-equal
"PENDING"))))
;;;;;;;;;
;;; Spies
@@ -853,6 +861,15 @@
(expect 'buttercup--print :to-have-been-called-with " FAILED\n"))
+ (it "should output the failure-description for a pending spec"
+ (setf (buttercup-spec-status spec) 'pending
+ (buttercup-spec-failure-description spec) "DESCRIPTION")
+ (let ((buttercup-reporter-batch--failures nil))
+ (buttercup-reporter-batch 'spec-done spec))
+ (expect (mapconcat (apply-partially #'apply #'format)
+ (spy-calls-all-args 'buttercup--print) "")
+ :to-match "DESCRIPTION"))
+
(it "should throw an error for an unknown spec status"
(setf (buttercup-spec-status spec) 'unknown)
- [nongnu] elpa/buttercup 657acef 102/340: Bump version: 1.4 → 1.5, (continued)
- [nongnu] elpa/buttercup 657acef 102/340: Bump version: 1.4 → 1.5, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 7e8898b 127/340: Implement :to-have-been-called-times matcher (close #90), ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup ca09040 130/340: Improve the Makefile, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a535e51 134/340: Fix a logic error in spy tests, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6ad9565 135/340: Fix several edge cases in "spy-on", ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 389dc43 139/340: Fix a problem with reporter tests suppressing failure messages, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 929a904 143/340: Implement closure-based expect macro, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 11d7fdc 148/340: Add "--help" option to buttercup command-line script, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 4106adc 170/340: Add release script, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 9b6cc79 177/340: travis: Test on 26.1, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 0d742b0 187/340: Set failure-description for pending specs,
ELPA Syncer <=
- [nongnu] elpa/buttercup 1c50a80 196/340: Fix the buttercup-run tests, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 810fa6f 197/340: Bump version: 1.15 → 1.16, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 4459f37 199/340: Add test for :var* argument, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup ff16814 216/340: travis: Always test on xenial, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bd851d4 217/340: Merge pull request #155 from snogge/travis-xenial, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 246ddd7 218/340: Merge pull request #152 from DarwinAwardWinner/suppress-warning-redirect, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 9408a72 220/340: Merge pull request #154 from DarwinAwardWinner/test-emacs-26.3, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 26e2ded 222/340: Rename some innacurate references to "fake" functions, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 9b87afc 234/340: Merge branch 'snogge/spy-context-tweaks', ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d8b596c 240/340: Merge branch 'doc-improve', ELPA Syncer, 2021/12/16