#50 Factored out preview assertion function

This commit is contained in:
Carlo Sciolla 2016-12-25 18:29:48 +01:00
parent e3e95fe1d5
commit f8148e9d5f
No known key found for this signature in database
GPG Key ID: BA5D71E6F3C580C1
1 changed files with 6 additions and 3 deletions

View File

@ -8,12 +8,15 @@
;;; Code:
(defun assert-preview (puml output)
(plantuml-preview-string 42 (read-test-file puml))
(sleep-for 2)
(should (equal (read-test-file output) (read-preview-buffer))))
(ert-deftest preview-test ()
(setq-local plantuml-jar-path plantuml-test-jar-path)
(setq-local plantuml-output-type "utxt")
(plantuml-preview-string 42 (read-test-file "a-b.puml"))
(sleep-for 2)
(should (equal (read-test-file "a-b.txt") (read-preview-buffer))))
(assert-preview "a-b.puml" "a-b.txt"))
(provide 'plantuml-mode-preview-test)