lisp/org-table.el: fix table alignment
[org-mode/org-tableheadings.git] / testing / lisp / test-ob-ruby.el
blob4d676fe19aa7f5f4987d6e949d31bec5b997ca1a
1 ;;; test-ob-ruby.el --- tests for ob-ruby.el
3 ;; Copyright (c) 2013-2015, 2019 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 org-test-ruby :results output
26 s = \"1\"
27 s = \"2\"
28 s = \"3\"
29 puts s
30 s = \"4\"
31 #+end_src"
32 (org-babel-execute-maybe)
33 (substring-no-properties
34 (buffer-string)))
35 "#+begin_src ruby :session org-test-ruby :results output
36 s = \"1\"
37 s = \"2\"
38 s = \"3\"
39 puts s
40 s = \"4\"
41 #+end_src
43 #+RESULTS:
44 : 3
45 ")))
46 (ert-deftest test-ob-ruby/session-output-2 ()
47 (should (equal (org-test-with-temp-text "#+begin_src ruby :session org-test-ruby :results output
48 puts s
49 s = \"5\"
50 #+end_src"
51 (org-babel-execute-maybe)
52 (substring-no-properties
53 (buffer-string)))
54 "#+begin_src ruby :session org-test-ruby :results output
55 puts s
56 s = \"5\"
57 #+end_src
59 #+RESULTS:
60 : 4
61 ")))
62 (ert-deftest test-ob-ruby/session-output-3 ()
63 (should (equal (org-test-with-temp-text "#+begin_src ruby :session org-test-ruby :results output
64 puts s
65 s = \"6\"
66 #+end_src"
67 (org-babel-execute-maybe)
68 (substring-no-properties
69 (buffer-string)))
70 "#+begin_src ruby :session org-test-ruby :results output
71 puts s
72 s = \"6\"
73 #+end_src
75 #+RESULTS:
76 : 5
77 ")))
79 (provide 'test-ob-ruby)
81 ;;; test-ob-ruby.el ends here