Fix `org-toggle-tag'
[org-mode/org-tableheadings.git] / testing / lisp / test-ob-plantuml.el
blob794d31322bb393fdf3046949750dde6a7b53f3de
1 ;;; test-ob-plantuml.el --- tests for ob-plantuml.el
3 ;; Copyright (c) 2016 Thibault Marin
4 ;; Authors: Thibault Marin
6 ;; This file is not part of GNU Emacs.
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ;;; Code:
22 (unless (featurep 'ob-plantuml)
23 (signal 'missing-test-dependency "Support for PlantUML code blocks"))
25 (ert-deftest test-ob-plantuml/single-var ()
26 "Test file output with input variable."
27 (should
28 (string=
29 "@startuml
30 !define CLASSNAME test_class
31 class CLASSNAME
32 @enduml"
33 (let ((org-plantuml-jar-path nil))
34 (org-test-with-temp-text
35 "#+name: variable_value
36 : test_class
38 #+header: :file tmp.puml
39 #+header: :var CLASSNAME=variable_value
40 #+begin_src plantuml
41 class CLASSNAME
42 #+end_src"
43 (org-babel-next-src-block)
44 (let ((src-block-info (cdr (org-babel-get-src-block-info))))
45 (org-babel-plantuml-make-body
46 (car src-block-info)
47 (car (cdr src-block-info)))))))))
50 (ert-deftest test-ob-plantuml/prologue ()
51 "Test file output with prologue."
52 (should
53 (string=
54 "@startuml
55 skinparam classBackgroundColor #FF0000
56 class test_class
57 @enduml"
58 (let ((org-plantuml-jar-path nil))
59 (org-test-with-temp-text
60 "#+header: :file tmp.puml
61 #+header: :prologue skinparam classBackgroundColor #FF0000
62 #+begin_src plantuml
63 class test_class
64 #+end_src"
65 (org-babel-next-src-block)
66 (let ((src-block-info (cdr (org-babel-get-src-block-info))))
67 (org-babel-plantuml-make-body
68 (car src-block-info)
69 (car (cdr src-block-info)))))))))
71 (provide 'test-ob-plantuml)
73 ;;; test-ob-plantuml.el ends here