[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup e26ea54 137/340: Let spy-on :and-return-value wo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup e26ea54 137/340: Let spy-on :and-return-value work with lists and symbols (close #104) |
Date: |
Thu, 16 Dec 2021 14:59:20 -0500 (EST) |
branch: elpa/buttercup
commit e26ea5408414268253cfb3d869ab3ca8b2864436
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Jorgen Schäfer <Jorgen.Schaefer@gmail.com>
Let spy-on :and-return-value work with lists and symbols (close #104)
---
buttercup.el | 2 +-
tests/test-buttercup.el | 42 +++++++++++++++++++++++++++++++++++++++++-
2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index 9d72eaa..570c63a 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -574,7 +574,7 @@ responsibility to ensure ARG is a command."
(:and-return-value
`(lambda (&rest args)
,orig-intform
- ,arg))
+ ',arg))
(:and-call-fake
(let ((replacement-intform (interactive-form arg)))
(when (and replacement-intform
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 805ea8b..c120574 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -688,7 +688,47 @@
(it "returns the specified value"
(expect (test-function 2 3)
:to-equal
- 23)))
+ 23))
+
+ (it "works with strings"
+ (spy-on 'test-function :and-return-value "return value")
+ (expect (test-function 2 3)
+ :to-equal
+ "return value"))
+
+ (it "works with vectors"
+ (spy-on 'test-function :and-return-value [1 2 3 4])
+ (expect (test-function 2 3)
+ :to-equal
+ [1 2 3 4]))
+
+ (it "works with symbols"
+ (spy-on 'test-function :and-return-value 'symbol)
+ (expect (test-function 2 3)
+ :to-equal
+ 'symbol))
+
+ (it "works with conses"
+ (spy-on 'test-function :and-return-value '(1 . 2))
+ (expect (test-function 2 3)
+ :to-equal
+ (cons 1 2)))
+
+ (it "works with lists"
+ (spy-on 'test-function :and-return-value '(1 2 3))
+ (expect (test-function 2 3)
+ :to-equal
+ '(1 2 3)))
+
+ (it "works with alists"
+ (spy-on 'test-function :and-return-value '((first . 1)
+
(second . 2)
+
(third . 3)))
+ (expect (test-function 2 3)
+ :to-equal
+ '((first . 1)
+ (second . 2)
+ (third . 3)))))
(describe ":and-call-fake keyword functionality"
(before-each
- [nongnu] elpa/buttercup 06c9699 104/340: Merge pull request #58 from Fuco1/to-equal-as-set, (continued)
- [nongnu] elpa/buttercup 06c9699 104/340: Merge pull request #58 from Fuco1/to-equal-as-set, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a6d9bde 105/340: Support more emacs parameters useful for pre-test initialization, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup abf2abe 109/340: Exclude hidden files and dirs in test root, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup f60ed2a 119/340: Bump version: 1.5 → 1.6, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 677d6d3 118/340: Merge pull request #70 from xendk/color-output, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d8dc80d 126/340: Bump version: 1.6 → 1.7, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b6deeff 128/340: Set Emacs 24.3 as minimum and clean outdated code (close #89), ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 39c7d8c 132/340: Allow ERT "should" and similar to work with buttercup, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e8140aa 133/340: Implement configurable stack traces, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e6f97d0 136/340: Release 1.8, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e26ea54 137/340: Let spy-on :and-return-value work with lists and symbols (close #104),
ELPA Syncer <=
- [nongnu] elpa/buttercup e55e3d8 138/340: travis: Test on 25.1 and 25.2, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup c032c8f 141/340: Exec code blocks in markdown labeled as "emacs-lisp" and "elisp", ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b97714d 144/340: Declare all variables before first use, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 4128f3e 147/340: Document ERT support in writing-tests.md, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 47dd72c 156/340: Set file local variables for consistent code style, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5458dcc 158/340: Replace buttercup-*-parents with buttercup-suite-or-spec-parents, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 77367d3 165/340: Change shebang to use /usr/bin/env, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bbbf692 166/340: Fix more compile warnings., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bcaa7f0 163/340: Use buttercup--specs where possible, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 61ebe91 171/340: Update README.md, ELPA Syncer, 2021/12/16