summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2024-07-07 18:40:25 +0200
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2024-07-07 18:41:12 +0200
commit38d3cb74d7f4c56a4a2a7235c50406912733f944 (patch)
treef3d06e591aa97820bf6020aafa5f3584135d5d10
parentb0efadb00ee0fa276d3a39fc110d450542318fcf (diff)
downloadmemory-leaks-38d3cb74d7f4c56a4a2a7235c50406912733f944.tar.xz
Add recipe for monkey-patching in ERT
-rw-r--r--guides/emacs/development.org7
1 files changed, 7 insertions, 0 deletions
diff --git a/guides/emacs/development.org b/guides/emacs/development.org
index 92e2909..f1363e1 100644
--- a/guides/emacs/development.org
+++ b/guides/emacs/development.org
@@ -67,6 +67,13 @@ a symbol -- Selects the test that the symbol names, signals an
PREDICATE is a function that takes an ert-test object as argument,
and returns non-nil if it is selected.
#+end_quote
+** Writing
+*** Mocking functions
+#+begin_src elisp
+(cl-letf (((symbol-function 'read-something)
+ (lambda (&rest _) "result")))
+ (some-command))
+#+end_src
* Third-party packages
** forge