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
10 (org-test-for-executable "R")
11 (unless (featurep 'ess
)
12 (signal 'missing-test-dependency
"ESS"))
13 (unless (featurep 'ob-R
)
14 (signal 'missing-test-dependency
"Support for R code blocks"))
16 (ert-deftest test-ob-R
/simple-session
()
17 (org-test-with-temp-text
18 "#+begin_src R :session R\n paste(\"Yep!\")\n#+end_src\n"
19 (should (string= "Yep!" (org-babel-execute-src-block)))))
21 (ert-deftest test-ob-R
/colnames-yes-header-argument
()
22 (org-test-with-temp-text "#+name: eg
28 #+header: :colnames yes
33 (org-babel-next-src-block)
34 (should (equal '(("col") hline
("a") ("b"))
35 (org-babel-execute-src-block)))))
37 (ert-deftest test-ob-R
/colnames-nil-header-argument
()
38 (org-test-with-temp-text "#+name: eg
44 #+header: :colnames nil
49 (org-babel-next-src-block)
50 (should (equal '(("col") hline
("a") ("b"))
51 (org-babel-execute-src-block)))))
53 (ert-deftest test-ob-R
/colnames-no-header-argument
()
54 (org-test-with-temp-text "#+name: eg
60 #+header: :colnames no
65 (org-babel-next-src-block)
66 (should (equal '(("col") ("a") ("b"))
67 (org-babel-execute-src-block)))))
71 ;;; test-ob-R.el ends here