123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- (let ((load-path (cons (expand-file-name
- ".." (file-name-directory
- (or load-file-name buffer-file-name)))
- load-path)))
- (require 'org-test)
- (require 'org-test-ob-consts))
- (ert-deftest test-ob-exp/org-babel-exp-src-blocks/w-no-headers ()
- "Testing export without any headlines in the org-mode file."
- (let ((html-file (concat (file-name-sans-extension org-test-no-heading-file)
- ".html")))
- (when (file-exists-p html-file) (delete-file html-file))
- (org-test-in-example-file org-test-no-heading-file
-
- (org-export-as-html nil))
-
- (should (file-exists-p html-file))
-
- (should-not (file-exists-p (concat org-test-no-heading-file "::")))
- (when (file-exists-p html-file) (delete-file html-file))))
- (ert-deftest test-ob-exp/org-babel-exp-src-blocks/w-no-file ()
- "Testing export from buffers which are not visiting any file."
- (when (get-buffer "*Org HTML Export*") (kill-buffer "*Org HTML Export*"))
- (should-not (get-buffer "*Org HTML Export*"))
-
- (org-test-in-example-file nil (org-export-as-html-to-buffer nil))
-
- (should (buffer-live-p (get-buffer "*Org HTML Export*")))
-
- (save-excursion
- (set-buffer (get-buffer "*Org HTML Export*"))
- (should (string-match (regexp-quote org-test-file-ob-anchor)
- (buffer-string))))
- (when (get-buffer "*Org HTML Export*") (kill-buffer "*Org HTML Export*")))
- (ert-deftest test-ob-exp/org-babel-exp-src-blocks/w-no-headers2 ()
- "Testing export without any headlines in the org-mode file."
- (let ((html-file (concat (file-name-sans-extension
- org-test-link-in-heading-file)
- ".html")))
- (when (file-exists-p html-file) (delete-file html-file))
- (org-test-in-example-file org-test-link-in-heading-file
-
- (org-export-as-html nil))
-
- (should (file-exists-p html-file))
-
- (should-not (file-exists-p (concat org-test-link-in-heading-file "::")))
- (when (file-exists-p html-file) (delete-file html-file))))
- (provide 'test-ob-exp)
|