`org-insert-heading' can be forced to insert top-level headline
[org-mode.git] / testing / lisp / test-ob-ruby.el
blobeb5233befc824ab471e2e5dee6cf4216193b0fe4
1 ;;; test-ob-ruby.el --- tests for ob-ruby.el
3 ;; Copyright (c) 2013-2015 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-babel-execute-maybe)
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-babel-execute-maybe)
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-babel-execute-maybe)
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