Skip to content

Commit 9bb00a2

Browse files
committed
Improve the docstring of the expect macro
1 parent 0552fe4 commit 9bb00a2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

buttercup.el

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,19 @@ Does not have the IGNORE-MISSING and SPLIT parameters."
196196
(defmacro expect (arg &optional matcher &rest args)
197197
"Expect a condition to be true.
198198
199-
This macro knows three forms:
199+
This macro knows two forms:
200200
201-
\(expect ARG :MATCHER ARGS...)
202-
Fail the current test if the matcher does not match these arguments.
201+
\(expect ARG :MATCHER [ARGS...])
202+
Fail the current test if the MATCHER does not match these arguments.
203+
The correct number of arguments depend on the MATCHER.
203204
See `buttercup-define-matcher' for more information on matchers.
204205
205-
\(expect (function ARG...))
206-
Fail the current test if the function call does not return a true value.
207-
208206
\(expect ARG)
209-
Fail the current test if ARG is not true."
207+
Fail the current test if ARG is not true.
208+
This is the same as (expect ARG :to-be-truthy).
209+
210+
All arguments can be a value or a single Lisp form. The evaluation of
211+
the arguments is delayed until the containing spec is executed."
210212
`(buttercup-expect ,(buttercup--wrap-expr arg)
211213
,(or matcher :to-be-truthy)
212214
,@(mapcar #'buttercup--wrap-expr args)))

0 commit comments

Comments
 (0)