summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-03-04 22:34:31 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-03-04 22:34:31 +0100
commit0c1916657a54593c5b265d8f42195d36033843d4 (patch)
tree69ad211defaef8e41bc19704c6dd6027cb15256d
parent8b5941330b4e67097ea527b7c950fc77fcfbf364 (diff)
downloadorg-mode-0c1916657a54593c5b265d8f42195d36033843d4.tar.gz
ob: Fix and add tests for mkdirp header argument
* testing/lisp/test-ob.el (test-ob-core/dir-mkdirp): Add tests.
-rw-r--r--testing/lisp/test-ob.el30
1 files changed, 25 insertions, 5 deletions
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index 33d6ae8..facc0a4 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -1608,12 +1608,32 @@ echo \"$data\"
))
(ert-deftest test-ob-core/dir-mkdirp ()
- (org-test-with-temp-text
- "#+begin_src sh :mkdirp yes :dir \"data/code\"
-pwd
+ "Test :mkdirp with :dir header combination."
+ (should-not
+ (org-test-with-temp-text-in-file
+ "#+begin_src emacs-lisp :dir \"data/code\"
+t
+#+end_src"
+ (org-babel-execute-src-block)
+ (message default-directory)
+ (file-directory-p "data/code")))
+ (should-not
+ (org-test-with-temp-text-in-file
+ "#+begin_src emacs-lisp :mkdirp no :dir \"data/code\"
+t
#+end_src"
- (org-babel-execute-src-block))
- (should (file-directory-p "data/code")))
+ (org-babel-execute-src-block)
+ (message default-directory)
+ (file-directory-p "data/code")))
+ (should
+ (org-test-with-temp-text-in-file
+ "#+begin_src emacs-lisp :mkdirp yes :dir \"data/code\"
+t
+#+end_src"
+ (org-babel-execute-src-block)
+ (message default-directory)
+ (prog1 (file-directory-p "data/code")
+ (delete-directory "data" t)))))
(ert-deftest test-ob/script-escape ()
;; Delimited lists of numbers