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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/buttercup 4128f3e 147/340: Document ERT support in writing


From: ELPA Syncer
Subject: [nongnu] elpa/buttercup 4128f3e 147/340: Document ERT support in writing-tests.md
Date: Thu, 16 Dec 2021 14:59:22 -0500 (EST)

branch: elpa/buttercup
commit 4128f3e51dab299068cb10be1cf31ad689ac9bec
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Jorgen Schäfer <Jorgen.Schaefer@gmail.com>

    Document ERT support in writing-tests.md
---
 docs/writing-tests.md | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/docs/writing-tests.md b/docs/writing-tests.md
index da1041d..b980a18 100644
--- a/docs/writing-tests.md
+++ b/docs/writing-tests.md
@@ -162,6 +162,21 @@ that are not included below.
         (expect (+ a 1) :to-throw 'void-variable '(a)))))
 ```
 
+If you are migrating from ERT, you can also use `should` and similar
+macros inside a buttercup test just like you would inside an
+`ert-deftest` form.
+
+```Emacs-Lisp
+(require 'ert)
+(describe "ERT support"
+  (it "allows you to use ERT macros in tests"
+    (let* ((a 12)
+           (b a))
+      (should (= a b))
+      (should-not (eq a nil))
+      (should-error (error "Throws an error")))))
+```
+
 ## Grouping Related Specs with `describe`
 
 The `describe` macro is for grouping related specs. The string



reply via email to

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