emacs-elpa-diffs
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]