Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update doc on fakir-mock-file

  • Loading branch information...
commit 78aa032876138329cdb6ea5e17d65b760ce81afa 1 parent 985608a
@nicferrier authored
Showing with 37 additions and 1 deletion.
  1. +20 −0 README.creole
  2. +17 −1 fakir.el
View
20 README.creole
@@ -10,6 +10,26 @@ Make a fakir-file, a struct.
Mock the filesystem with the //fakir-file// object.
+The Emacs Lisp file operations are flet'd so that they operate on
+the //fakir-file//.
+
+For example:
+
+{{{
+ (fakir-mock-file (//fakir-file//
+ :filename "README"
+ :directory "/home/emacs/fakir")
+ (expand-file-name "~/fakir/README"))
+}}}
+
+{{{
+ => "/home/emacs/fakir/README"
+}}}
+
+The operations that are supported by the fleted functions are:
+`file-attributes', `file-exists-p[[ and `expand-file-name]]. Others
+will be added as necessary.
+
=== fakir-mock-process process-bindings &rest body ===
View
18 fakir.el
@@ -353,7 +353,23 @@ part."
(defmacro fakir-mock-file (fakir-file &rest body)
- "Mock the filesystem with the FAKIR-FILE object."
+ "Mock the filesystem with the FAKIR-FILE object.
+
+The Emacs Lisp file operations are flet'd so that they operate on
+the FAKIR-FILE.
+
+For example:
+
+ (fakir-mock-file (fakir-file
+ :filename \"README\"
+ :directory \"/home/emacs/fakir\")
+ (expand-file-name \"~/fakir/README\"))
+
+ => \"/home/emacs/fakir/README\"
+
+The operations that are supported by the fleted functions are:
+`file-attributes', `file-exists-p' and `expand-file-name'. Others
+will be added as necessary."
(declare (debug (sexp &rest form))
(indent defun))
(let ((fv (make-symbol "fakir-filev")))
Please sign in to comment.
Something went wrong with that request. Please try again.