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

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

[nongnu] elpa/buttercup a535e51 134/340: Fix a logic error in spy tests


From: ELPA Syncer
Subject: [nongnu] elpa/buttercup a535e51 134/340: Fix a logic error in spy tests
Date: Thu, 16 Dec 2021 14:59:19 -0500 (EST)

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

    Fix a logic error in spy tests
    
    If "before-each" is used, then some tests, like "restores the old
    value after a spec run", become meaningless, since the before-each
    form is always going to restore the value anyway. This commit uses
    "before-all" instead.
---
 tests/test-buttercup.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index e488b61..629f043 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -505,7 +505,10 @@
 
 (describe "The Spy "
   (let (test-function)
-    (before-each
+    ;; We use `before-all' here because some tests need to access the
+    ;; same function as previous tests in order to work, so overriding
+    ;; the function before each test would invalidate those tests.
+    (before-all
       (fset 'test-function (lambda (a b)
                              (+ a b))))
 



reply via email to

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