org.texi (Durations and time values): Fix typo.
[org-mode/org-mode-NeilSmithlineMods.git] / testing / lisp / test-ob-R.el
blob2dfd141ff3dfbb8c28106c7430162ee842b985f9
1 ;;; test-ob-R.el --- tests for ob-R.el
3 ;; Copyright (c) 2011 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)))
16 load-path)))
17 (require 'org-test)
18 (require 'org-test-ob-consts))
20 (require 'ob-R)
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
29 | col |
30 |-----|
31 | a |
32 | b |
34 #+header: :colnames yes
35 #+header: :var x = eg
36 #+begin_src R
38 #+end_src"
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
45 | col |
46 |-----|
47 | a |
48 | b |
50 #+header: :colnames nil
51 #+header: :var x = eg
52 #+begin_src R
54 #+end_src"
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
61 | col |
62 |-----|
63 | a |
64 | b |
66 #+header: :colnames no
67 #+header: :var x = eg
68 #+begin_src R
70 #+end_src"
71 (org-babel-next-src-block)
72 (should (equal '(("col") ("a") ("b"))
73 (org-babel-execute-src-block)))))
75 (provide 'test-ob-R)
77 ;;; test-ob-R.el ends here