Enable multiple files in :includes header
[org-mode.git] / testing / lisp / test-ob-ruby.el
blobee7e837eb44faf7184786ee00294713de864014b
1 ;;; test-ob-ruby.el --- tests for ob-ruby.el
3 ;; Copyright (c) 2013 Oleh Krehel
4 ;; Authors: Oleh Krehel
6 ;; This program is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation, either version 3 of the License, or
9 ;; (at your option) any later version.
11 ;; This program is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;; GNU General Public License for more details.
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
19 ;;; Code:
20 (org-test-for-executable "ruby")
21 (unless (featurep 'ob-ruby)
22 (signal 'missing-test-dependency "Support for Ruby code blocks"))
24 (ert-deftest test-ob-ruby/session-output-1 ()
25 (should (equal (org-test-with-temp-text "#+begin_src ruby :session :results output
26 s = \"1\"
27 s = \"2\"
28 s = \"3\"
29 puts s
30 #+end_src"
31 (org-ctrl-c-ctrl-c)
32 (substring-no-properties
33 (buffer-string)))
34 "#+begin_src ruby :session :results output
35 s = \"1\"
36 s = \"2\"
37 s = \"3\"
38 puts s
39 #+end_src
41 #+RESULTS:
42 : 3
44 ")))
45 (ert-deftest test-ob-ruby/session-output-2 ()
46 (should (equal (org-test-with-temp-text "#+begin_src ruby :session :results output
47 s = \"5\"
48 puts s
49 #+end_src"
50 (org-ctrl-c-ctrl-c)
51 (substring-no-properties
52 (buffer-string)))
53 "#+begin_src ruby :session :results output
54 s = \"5\"
55 puts s
56 #+end_src
58 #+RESULTS:
59 : 5
61 ")))
62 (ert-deftest test-ob-ruby/session-output-3 ()
63 (should (equal (org-test-with-temp-text "#+begin_src ruby :session :results output
64 puts s
65 #+end_src"
66 (org-ctrl-c-ctrl-c)
67 (substring-no-properties
68 (buffer-string)))
69 "#+begin_src ruby :session :results output
70 puts s
71 #+end_src
73 #+RESULTS:
74 : 5
76 ")))
78 (provide 'test-ob-ruby)
80 ;;; test-ob-ruby.el ends here