[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup fd70ccf 002/340: Specs are now structs.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup fd70ccf 002/340: Specs are now structs. |
Date: |
Thu, 16 Dec 2021 14:58:53 -0500 (EST) |
branch: elpa/buttercup
commit fd70ccf90ef81b5454557fceb444baf393012802
Author: Jorgen Schaefer <contact@jorgenschaefer.de>
Commit: Jorgen Schaefer <contact@jorgenschaefer.de>
Specs are now structs.
---
buttercup.el | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index d146d1f..4e6ad5b 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -141,8 +141,8 @@ should describe why a negated matcher failed."
(error
(cons t (format "Expected %S not to throw an error" function)))))
-;;;;;;;;;;
-;;; Suites
+;;;;;;;;;;;;;;;;;;;;
+;;; describe: Suites
(cl-defstruct buttercup-suite
description
@@ -155,9 +155,6 @@ should describe why a negated matcher failed."
(append (buttercup-suite-nested parent)
(list child))))
-;;;;;;;;;;;;
-;;; describe
-
(defvar buttercup-suites nil
"The list of all currently defined Buttercup suites.")
@@ -184,8 +181,12 @@ form.")
(setq buttercup-suites (append buttercup-suites
(list buttercup--current-suite))))))
-;;;;;;
-;;; it
+;;;;;;;;;;;;;
+;;; Specs: it
+
+(cl-defstruct buttercup-spec
+ description
+ function)
(defmacro it (description &rest body)
"Define a spec."
@@ -197,8 +198,9 @@ form.")
(when (not description)
(error "`it' has to be called from within a `describe' form."))
(buttercup-suite-add-nested buttercup--current-suite
- (cons description
- body-function)))
+ (make-buttercup-spec
+ :description description
+ :function body-function)))
;; (let* ((buttercup--descriptions (cons description
;; buttercup--descriptions))
@@ -244,14 +246,15 @@ form.")
(indent (make-string (* 2 level) ?\s)))
(message "%s%s\n" indent (buttercup-suite-description suite))
(dolist (sub (buttercup-suite-nested suite))
- (if (buttercup-suite-p sub)
- (progn
- (message "")
- (buttercup-run-suite sub (1+ level)))
+ (cond
+ ((buttercup-suite-p sub)
+ (message "")
+ (buttercup-run-suite sub (1+ level)))
+ ((buttercup-spec-p sub)
(message "%s%s"
(make-string (* 2 (1+ level)) ?\s)
- (car sub))
- (funcall (cdr sub))))
+ (buttercup-spec-description sub)))
+ (funcall (buttercup-spec-function sub))))
(message "")))
(defun buttercup-markdown-runner ()
- [nongnu] elpa/buttercup 8e30284 024/340: Disabled suites, pending specs., (continued)
- [nongnu] elpa/buttercup 8e30284 024/340: Disabled suites, pending specs., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 89c00aa 009/340: Makefile: Make the emacs command configurable, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 7e20ff1 021/340: ROADMAP.md: New file., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 764d6aa 020/340: Tests for the it macro and buttercup-it function., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d5572a6 034/340: Refactoring of the cleanup code., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b75b3e9 036/340: Add a discovery test runner., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 7eecb96 038/340: Remove commented-out backtrace code from buttercup.el., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 3483449 045/340: Typo fix., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 84002e9 054/340: Add parent relations to specs and suites., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a7d9813 010/340: Add cl-defstruct compatibility alias., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup fd70ccf 002/340: Specs are now structs.,
ELPA Syncer <=
- [nongnu] elpa/buttercup ba40ff8 027/340: Spies: :and-return-value, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 20b87dd 031/340: Refactoring of spy-on to be more concise and DRY., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bb31c85 043/340: Edebugable., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5d369cd 007/340: Do not use emacs-snapshot from EVM, that's slow., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 07b1ee6 008/340: Add compatibility definition for define-error, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 7cdb219 028/340: Spies: :and-call-fake, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5db449f 025/340: Spies, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d580e5c 011/340: Add build status badge., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 3637e3d 015/340: Add more extensive matcher tests to the README., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a277b0e 022/340: Setup and teardown: before-each, after-each, before-all, after-all, ELPA Syncer, 2021/12/16