Ensure return value of ert-with-temp-directory
* lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Ensure return value when :directory is t is the directory name. * test/lisp/emacs-lisp/ert-x-tests.el (ert-x-tests-with-temp-directory): Extend test for the above.
This commit is contained in:
parent
385741fae2
commit
0cac4598a7
2 changed files with 5 additions and 2 deletions
|
@ -445,7 +445,9 @@ See also `ert-with-temp-directory'."
|
|||
(or (macroexp-file-name) buffer-file-name)))))
|
||||
`(let* ((,temp-file (,(if directory 'file-name-as-directory 'identity)
|
||||
(make-temp-file ,prefix ,directory ,suffix ,text)))
|
||||
(,name ,temp-file))
|
||||
(,name ,(if directory
|
||||
`(file-name-as-directory ,temp-file)
|
||||
temp-file)))
|
||||
(unwind-protect
|
||||
(progn ,@body)
|
||||
(ignore-errors
|
||||
|
|
|
@ -320,7 +320,8 @@ desired effect."
|
|||
(ert-with-temp-directory dir
|
||||
(setq saved dir)
|
||||
(should (file-exists-p dir))
|
||||
(should (file-directory-p dir)))
|
||||
(should (file-directory-p dir))
|
||||
(should (equal dir (file-name-as-directory dir))))
|
||||
(should-not (file-exists-p saved))))
|
||||
|
||||
(ert-deftest ert-x-tests-with-temp-directory/text-signals-error ()
|
||||
|
|
Loading…
Add table
Reference in a new issue