1 ;;; test-ob-R.el --- tests for ob-R.el
3 ;; Copyright (c) 2011-2012 Eric Schulte
4 ;; Authors: Eric Schulte
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
9 (org-test-for-executable "R")
10 (unless (featurep 'ess
)
11 (signal 'missing-test-dependency
"ESS"))
13 (let ((load-path (cons (expand-file-name
14 ".." (file-name-directory
15 (or load-file-name buffer-file-name
)))
18 (require 'org-test-ob-consts
))
22 (ert-deftest test-ob-R
/simple-session
()
23 (org-test-with-temp-text
24 "#+begin_src R :session R\n paste(\"Yep!\")\n#+end_src\n"
25 (should (string= "Yep!" (org-babel-execute-src-block)))))
27 (ert-deftest test-ob-R
/colnames-yes-header-argument
()
28 (org-test-with-temp-text "#+name: eg
34 #+header: :colnames yes
39 (org-babel-next-src-block)
40 (should (equal '(("col") hline
("a") ("b"))
41 (org-babel-execute-src-block)))))
43 (ert-deftest test-ob-R
/colnames-nil-header-argument
()
44 (org-test-with-temp-text "#+name: eg
50 #+header: :colnames nil
55 (org-babel-next-src-block)
56 (should (equal '(("col") hline
("a") ("b"))
57 (org-babel-execute-src-block)))))
59 (ert-deftest test-ob-R
/colnames-no-header-argument
()
60 (org-test-with-temp-text "#+name: eg
66 #+header: :colnames no
71 (org-babel-next-src-block)
72 (should (equal '(("col") ("a") ("b"))
73 (org-babel-execute-src-block)))))
77 ;;; test-ob-R.el ends here