Skip to content

Commit

Permalink
update doc on fakir-mock-file
Browse files Browse the repository at this point in the history
  • Loading branch information
nicferrier committed Mar 18, 2012
1 parent 985608a commit 78aa032
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.creole
Expand Up @@ -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 ===

Expand Down
18 changes: 17 additions & 1 deletion fakir.el
Expand Up @@ -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")))
Expand Down

0 comments on commit 78aa032

Please sign in to comment.