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

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

[nongnu] scratch/el-mock e65ec012a7 44/64: Document that and when argume


From: Stefan Monnier
Subject: [nongnu] scratch/el-mock e65ec012a7 44/64: Document that and when arguments and return values are evaluated
Date: Mon, 28 Aug 2023 23:01:41 -0400 (EDT)

branch: scratch/el-mock
commit e65ec012a724d0f2518e6601279a07e34716cc45
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>

    Document that and when arguments and return values are evaluated
---
 el-mock.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/el-mock.el b/el-mock.el
index 812cc12c3f..136d067df8 100644
--- a/el-mock.el
+++ b/el-mock.el
@@ -195,6 +195,7 @@ Synopsis:
 * (stub FUNCTION => RETURN-VALUE)
   Create a FUNCTION stub which returns RETURN-VALUE.
 
+RETURN-VALUE is evaluated when executing the mocked function.
 
 Example:
   (with-mock
@@ -231,6 +232,11 @@ Synopsis:
 Wildcard:
 The `*' is a special symbol: it accepts any value for that argument position.
 
+ARGS that are not `*' are evaluated when the mock is verified,
+i.e. upon leaving the enclosing `with-mock' form.  ARGS are
+evaluated using dynamic scoping.  The RETURN-VALUE is evaluated
+when executing the mocked function.
+
 Example:
   (with-mock
     (mock (f * 2) => 3)
@@ -307,6 +313,11 @@ Spec is arguments of `mock', `not-called' or `stub'.
 * (FUNCTION => RETURN-VALUE)            ; stub which returns RETURN-VALUE
 * (FUNCTION not-called)                 ; not-called FUNCTION
 
+ARGS that are not `*' are evaluated when the mock is verified,
+i.e. upon leaving the enclosing `with-mock' form.  ARGS are
+evaluated using dynamic scoping.  The RETURN-VALUE is evaluated
+when executing the mocked function.
+
 Example:
   (mocklet (((mock-nil 1))
             ((mock-1 *) => 1)



reply via email to

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