[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup 9b94921 276/340: test: Add tests for buttercup-r
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup 9b94921 276/340: test: Add tests for buttercup-reporter-batch buttercup-done handling |
Date: |
Thu, 16 Dec 2021 14:59:50 -0500 (EST) |
branch: elpa/buttercup
commit 9b9492179dabbf4b03e78b0e7889745659d6d8ed
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>
test: Add tests for buttercup-reporter-batch buttercup-done handling
Verify actual output instead of just no error.
---
tests/test-buttercup.el | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 7f051be..c2d6c0b 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -1149,16 +1149,36 @@ text properties using `ansi-color-apply'."
(expect (buttercup-output) :to-equal "")))
(describe "on the buttercup-done event"
- ;; This is a lie. It should do a ton more stuff. We should test
- ;; that, too.
- (it "should handle the end event"
- (buttercup-reporter-batch 'buttercup-done nil))
+ :var ((buttercup-reporter-batch--start-time (current-time))
+ defined-specs pending-specs failed-specs)
+
+ (before-each
+ (setq defined-specs 10 pending-specs 0 failed-specs 0)
+ (spy-on 'buttercup-suites-total-specs-defined :and-call-fake (lambda
(&rest a) defined-specs))
+ (spy-on 'buttercup-suites-total-specs-pending :and-call-fake (lambda
(&rest a) pending-specs))
+ (spy-on 'buttercup-suites-total-specs-failed :and-call-fake (lambda
(&rest a) failed-specs)))
+
+ (it "should print a summary of run and failing specs"
+ (setq failed-specs 6)
+ (let (buttercup-reporter-batch--failures)
+ (buttercup-reporter-batch 'buttercup-done nil))
+ (expect (buttercup-output) :to-match
+ "Ran 10 specs, 6 failed, in [0-9]+.[0-9]+[mu]?s.\n"))
+
+ (it "should print a summary separating run and pending specs"
+ (setq pending-specs 3)
+ (let (buttercup-reporter-batch--failures)
+ (buttercup-reporter-batch 'buttercup-done nil))
+ (expect (buttercup-output) :to-match
+ "Ran 7 out of 10 specs, 0 failed, in [0-9]+.[0-9]+[mu]?s.\n"))
(it "should not raise any error even if a spec failed"
(setf (buttercup-spec-status spec) 'failed)
-
- (expect (buttercup-reporter-batch 'buttercup-done (list spec))
- :not :to-throw)))
+ (let (buttercup-reporter-batch--failures)
+ (expect (buttercup-reporter-batch 'buttercup-done (list spec))
+ :not :to-throw)))
+ ;; TODO: Backtrace tests
+ )
(describe "on an unknown event"
(it "should raise an error"
- [nongnu] elpa/buttercup 0e6c09e 271/340: Correct the assume docstring, (continued)
- [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, 2021/12/16
- [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 <=
- [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
- [nongnu] elpa/buttercup 2d77e18 300/340: test: Correct descriptions for some suite-done specs, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d41c6dc 301/340: Extract buttercup-reporter-batch--print-summary, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 74e74e2 302/340: Extract buttercup-reporter-batch--print-failed-spec-report, ELPA Syncer, 2021/12/16