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

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

[nongnu] elpa/buttercup 435fc0d378 4/9: tests: Fix some buttercup-expect


From: ELPA Syncer
Subject: [nongnu] elpa/buttercup 435fc0d378 4/9: tests: Fix some buttercup-expect tests
Date: Wed, 10 Aug 2022 18:58:14 -0400 (EDT)

branch: elpa/buttercup
commit 435fc0d378bd2855e02418e5398f61cd94364f6d
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>

    tests: Fix some buttercup-expect tests
    
    * Use buttercup--wrap-expr
    * Use functions instead of local matchers (as they are not local but
      global)
    * Use expressions that return the opposite of the matchers.
    
    for these tests
    
    The `buttercup-expect' function
      with a matcher argument
        should not raise an error if the matcher returns true
        should raise an error if the matcher returns false
---
 tests/test-buttercup.el | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 17a49e036b..c46d0785ed 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -197,16 +197,13 @@ text properties using `ansi-color-apply'."
               'buttercup-failed)))
 
   (describe "with a matcher argument"
-    (buttercup-define-matcher :always-true (_a) t)
-    (buttercup-define-matcher :always-false (_a) nil)
-
     (it "should not raise an error if the matcher returns true"
-      (expect (buttercup-expect (lambda () 1) :always-true)
+      (expect (buttercup-expect (buttercup--wrap-expr (ignore)) #'always)
               :not :to-throw
               'buttercup-failed))
 
     (it "should raise an error if the matcher returns false"
-      (expect (buttercup-expect (buttercup--wrap-expr 1) :always-false)
+      (expect (buttercup-expect (buttercup--wrap-expr t) #'ignore)
               :to-throw
               'buttercup-failed))))
 



reply via email to

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