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/>.
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."
30 !define CLASSNAME test_class
33 (let ((org-plantuml-jar-path nil
))
34 (org-test-with-temp-text
35 "#+name: variable_value
38 #+header: :file tmp.puml
39 #+header: :var CLASSNAME=variable_value
43 (org-babel-next-src-block)
44 (let ((src-block-info (cdr (org-babel-get-src-block-info))))
45 (org-babel-plantuml-make-body
47 (car (cdr src-block-info
)))))))))
50 (ert-deftest test-ob-plantuml
/prologue
()
51 "Test file output with prologue."
55 skinparam classBackgroundColor #FF0000
58 (let ((org-plantuml-jar-path nil
))
59 (org-test-with-temp-text
60 "#+header: :file tmp.puml
61 #+header: :prologue skinparam classBackgroundColor #FF0000
65 (org-babel-next-src-block)
66 (let ((src-block-info (cdr (org-babel-get-src-block-info))))
67 (org-babel-plantuml-make-body
69 (car (cdr src-block-info
)))))))))
71 (provide 'test-ob-plantuml
)
73 ;;; test-ob-plantuml.el ends here