[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup 2b5233d6bf 02/10: docs: Describe how to skip tes
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup 2b5233d6bf 02/10: docs: Describe how to skip tests conditionally |
Date: |
Mon, 26 Feb 2024 18:59:16 -0500 (EST) |
branch: elpa/buttercup
commit 2b5233d6bfa717b5136304a36451b06e49861451
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>
docs: Describe how to skip tests conditionally
The assume macro has been present for a long time but has never been
described in the documentation.
---
docs/writing-tests.md | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/docs/writing-tests.md b/docs/writing-tests.md
index 083f5fb33b..d940985275 100644
--- a/docs/writing-tests.md
+++ b/docs/writing-tests.md
@@ -369,6 +369,21 @@ pending in results.
(it "can be declared with `it' but without a body"))
```
+## Conditionally Skipping Specs
+
+Use the `assume` macro to conditionally skip a spec.
+
+```Emacs-Lisp
+(describe "Conditionally skip specs"
+ (it "with the `assume' macro"
+ (assume (fboundp 'new-function) "`new-function' not availeble")
+ (expect (new-function))))
+```
+
+If the first argument to `assume` evals to nil, the spec will be
+marked as pending, and the second arg `message` will be added to the
+output.
+
## Spies
Buttercup has test double functions called spies. While other
- [nongnu] elpa/buttercup updated (f2f7f81a83 -> c0764a764c), ELPA Syncer, 2024/02/26
- [nongnu] elpa/buttercup 2b5233d6bf 02/10: docs: Describe how to skip tests conditionally,
ELPA Syncer <=
- [nongnu] elpa/buttercup 7a22c7a384 07/10: Use OClosures for enclosed expressions on Emacs ≥ 29, ELPA Syncer, 2024/02/26
- [nongnu] elpa/buttercup c0764a764c 10/10: Bump version: 1.33 → 1.34, ELPA Syncer, 2024/02/26
- [nongnu] elpa/buttercup ddda579b91 03/10: gitignore ELPA-generated files, ELPA Syncer, 2024/02/26
- [nongnu] elpa/buttercup 7742f9ff44 01/10: Test on GNU Emacs 29.2, ELPA Syncer, 2024/02/26
- [nongnu] elpa/buttercup b470fdfbdb 05/10: Use the #' syntax for function symbols, ELPA Syncer, 2024/02/26
- [nongnu] elpa/buttercup 61679966dd 08/10: test: Update tests to work with OClosures, ELPA Syncer, 2024/02/26
- [nongnu] elpa/buttercup 40363d12d3 09/10: Merge pull request #242 from snogge/oclosure, ELPA Syncer, 2024/02/26
- [nongnu] elpa/buttercup 3c6c88825d 06/10: Use &rest args in advice definition for display-warning, ELPA Syncer, 2024/02/26
- [nongnu] elpa/buttercup 2dc8656347 04/10: Remove obsolete compat code, ELPA Syncer, 2024/02/26