[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup 4f68f0b 059/340: The buttercup-spec-full-name fu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup 4f68f0b 059/340: The buttercup-spec-full-name function. |
Date: |
Thu, 16 Dec 2021 14:59:04 -0500 (EST) |
branch: elpa/buttercup
commit 4f68f0bfcebd8ffcd852466baa71b7e6136b667b
Author: Jorgen Schaefer <contact@jorgenschaefer.de>
Commit: Jorgen Schaefer <contact@jorgenschaefer.de>
The buttercup-spec-full-name function.
---
buttercup-test.el | 20 ++++++++++++++++++++
buttercup.el | 9 +++++++++
2 files changed, 29 insertions(+)
diff --git a/buttercup-test.el b/buttercup-test.el
index 06f7a56..574c03b 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -225,6 +225,26 @@
:to-equal
"su1 su2"))))
+(describe "The `buttercup-spec-full-name' function"
+ (let (su1 su2 sp1)
+ (before-each
+ (setq su1 (make-buttercup-suite :description "su1")
+ su2 (make-buttercup-suite :description "su2")
+ sp1 (make-buttercup-spec :description "sp1")
+ sp2 (make-buttercup-spec :description "sp2"))
+ (buttercup-suite-add-child su1 su2)
+ (buttercup-suite-add-child su2 sp2))
+
+ (it "should return the full name of a spec without parents"
+ (expect (buttercup-spec-full-name sp1)
+ :to-equal
+ "sp1"))
+
+ (it "should return the full name of a spec with parents"
+ (expect (buttercup-spec-full-name sp2)
+ :to-equal
+ "su1 su2 sp2"))))
+
;;;;;;;;;;;;;;;;;;;;
;;; Suites: describe
diff --git a/buttercup.el b/buttercup.el
index 7b42d71..9012789 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -278,6 +278,15 @@ MATCHER is either a matcher defined with
(reverse name-parts)
" ")))
+(defun buttercup-spec-full-name (spec)
+ "Return the full name of SPEC, which includes the full name of its suite."
+ (let ((parent (buttercup-spec-parent spec)))
+ (if parent
+ (concat (buttercup-suite-full-name parent)
+ " "
+ (buttercup-spec-description spec))
+ (buttercup-spec-description spec))))
+
;;;;;;;;;;;;;;;;;;;;
;;; Suites: describe
- [nongnu] elpa/buttercup d264da3 075/340: Merge pull request #17 from Fuco1/master, (continued)
- [nongnu] elpa/buttercup d264da3 075/340: Merge pull request #17 from Fuco1/master, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 8c486e6 067/340: Move print settings to the batch reporter where they belong., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 0f3eb63 078/340: Show actual function arguments when a spy fails., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 357e73b 085/340: Remove debug message, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 68692d9 113/340: Update Travis configuration instructions, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 54696b0 124/340: Merge pull request #78 from Fuco1/feature/buttercup-minor-mode, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 77f0c74 122/340: Fix :to-have-same-items-as (fix #80), ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 20ec520 145/340: Rename functions and arguments for closure manipulation, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5d1f338 146/340: Move let-binding outside loop for efficiency, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 7fa79c4 048/340: Expand and improve the package commentary., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 4f68f0b 059/340: The buttercup-spec-full-name function.,
ELPA Syncer <=
- [nongnu] elpa/buttercup ef7b730 063/340: Various improvements of the batch reporter., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a55a638 064/340: More and better tests for the batch reporter., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup c7df9f6 069/340: Add 24.5., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 0c5cc32 057/340: The buttercup-suites-total-specs-defined function., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup ea8effb 095/340: Add the :var argument to describe, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 23472e9 099/340: :to-match: Show correct error messages, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup cc52444 107/340: feature/windows-bin-support: support for windows, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 3ef90b4 100/340: :to-match: Don't switch t/nil!, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup ab2a558 111/340: Add projectile integration info to Readme, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 0124cc4 129/340: Signal an error when ":to-throw" is used on a non-function (#97), ELPA Syncer, 2021/12/16