diff options
author | Charles Berry <ccberry@ucsd.edu> | 2016-01-24 10:04:43 -0800 |
---|---|---|
committer | Charles Berry <ccberry@ucsd.edu> | 2016-01-24 10:08:31 -0800 |
commit | 27b590c39551f9aae79d801f61125cbaf1bd896c (patch) | |
tree | fba62215d9acb0e86d5f46b380cc9fabbe1df447 | |
parent | 53472b9c44f49ae15877a1a0af78cfcb5a3d6043 (diff) | |
download | org-mode-27b590c39551f9aae79d801f61125cbaf1bd896c.tar.gz |
testing/lisp/test-ob-R.el: Initialize ESS vars for :session tests
* test-ob-R.el: (test-ob-R/simple-session, test-ob-R/results-file)
tests start sessions. As a consequence `ess-ask-for-ess-directory'
and `ess-history-file' are let bound to `nil' to avoid prompting for
the startup directory and using a history file.
Bug Reported by: Achim Gratz
Subject: [Bug] Testing: ESS (*R*, R (newest)) starting data directory?
Archived-At: <http://permalink.gmane.org/gmane.emacs.orgmode/104424>
-rw-r--r-- | testing/lisp/test-ob-R.el | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/testing/lisp/test-ob-R.el b/testing/lisp/test-ob-R.el index 744a706..f065cab 100644 --- a/testing/lisp/test-ob-R.el +++ b/testing/lisp/test-ob-R.el @@ -26,7 +26,7 @@ (signal 'missing-test-dependency "Support for R code blocks")) (ert-deftest test-ob-R/simple-session () - (let ((ess-ask-for-ess-directory nil)) + (let (ess-ask-for-ess-directory ess-history-file) (org-test-with-temp-text "#+begin_src R :session R\n paste(\"Yep!\")\n#+end_src\n" (should (string= "Yep!" (org-babel-execute-src-block)))))) @@ -80,21 +80,23 @@ x (org-babel-execute-src-block))))) (ert-deftest test-ob-R/results-file () - (org-test-with-temp-text "#+NAME: TESTSRC + (let (ess-ask-for-ess-directory ess-history-file) + (org-test-with-temp-text + "#+NAME: TESTSRC #+BEGIN_SRC R :results file a <- file.path(\"junk\", \"test.org\") a #+END_SRC" - (goto-char (point-min)) (org-babel-execute-maybe) - (org-babel-goto-named-result "TESTSRC") (forward-line 1) - (should (string= "[[file:junk/test.org]]" - (buffer-substring-no-properties (point-at-bol) (point-at-eol)))) - (goto-char (point-min)) (forward-line 1) - (insert "#+header: :session\n") - (goto-char (point-min)) (org-babel-execute-maybe) - (org-babel-goto-named-result "TESTSRC") (forward-line 1) - (should (string= "[[file:junk/test.org]]" - (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))) + (goto-char (point-min)) (org-babel-execute-maybe) + (org-babel-goto-named-result "TESTSRC") (forward-line 1) + (should (string= "[[file:junk/test.org]]" + (buffer-substring-no-properties (point-at-bol) (point-at-eol)))) + (goto-char (point-min)) (forward-line 1) + (insert "#+header: :session\n") + (goto-char (point-min)) (org-babel-execute-maybe) + (org-babel-goto-named-result "TESTSRC") (forward-line 1) + (should (string= "[[file:junk/test.org]]" + (buffer-substring-no-properties (point-at-bol) (point-at-eol))))))) (provide 'test-ob-R) ;;; test-ob-R.el ends here |