Tests: (org-ql-it) Expand using Buttercup's it
As the implementation of `it' changes, this will change with it (correctly).
This commit is contained in:
parent
6c9c0b957a
commit
0304a2c9dc
1 changed files with 10 additions and 13 deletions
|
|
@ -112,20 +112,17 @@ FILENAME should be a file in the \"tests\" directory."
|
||||||
;;;; Macros
|
;;;; Macros
|
||||||
|
|
||||||
(defmacro org-ql-it (description &rest body)
|
(defmacro org-ql-it (description &rest body)
|
||||||
"Expand to two specs, one of which tests with preambles and the other without.
|
"Expand to two specs, one of which tests with preambles and the other without."
|
||||||
Based on Buttercup macro `it'."
|
|
||||||
(declare (indent 1) (debug (&define sexp def-body)))
|
(declare (indent 1) (debug (&define sexp def-body)))
|
||||||
(if body
|
|
||||||
`(progn
|
`(progn
|
||||||
(buttercup-it ,(concat description " (preamble) ")
|
(it ,(concat description " (preamble) ")
|
||||||
(lambda ()
|
,(when body
|
||||||
(let ((org-ql-use-preamble t))
|
`(let ((org-ql-use-preamble t))
|
||||||
,@body)))
|
,@body)))
|
||||||
(buttercup-it ,(concat description " (no preamble)")
|
(it ,(concat description " (no preamble) ")
|
||||||
(lambda ()
|
,(when body
|
||||||
(let ((org-ql-use-preamble nil))
|
`(let ((org-ql-use-preamble nil))
|
||||||
,@body))))
|
,@body)))) )
|
||||||
`(buttercup-xit ,description)))
|
|
||||||
|
|
||||||
(cl-defmacro org-ql-expect (ql-args results &key (buffer 'org-ql-test-buffer))
|
(cl-defmacro org-ql-expect (ql-args results &key (buffer 'org-ql-test-buffer))
|
||||||
"Expand to `expect' test form that expects QL-ARGS to equal RESULTS.
|
"Expand to `expect' test form that expects QL-ARGS to equal RESULTS.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue