|
@@ -13,20 +13,23 @@
|
|
|
|
|
|
;;; Code:
|
|
;;; Code:
|
|
(require 'org-test)
|
|
(require 'org-test)
|
|
|
|
+(require 'org-test-ob-consts)
|
|
|
|
|
|
|
|
|
|
;;; Tests
|
|
;;; Tests
|
|
(ert-deftest test-ob-exp/org-babel-exp-src-blocks/w-no-headers ()
|
|
(ert-deftest test-ob-exp/org-babel-exp-src-blocks/w-no-headers ()
|
|
"Testing export without any headlines in the org-mode file."
|
|
"Testing export without any headlines in the org-mode file."
|
|
- (org-test-in-example-file org-test-no-header-file
|
|
|
|
- ;; export the file to html
|
|
|
|
- (org-export-as-html nil)
|
|
|
|
|
|
+ (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
|
|
|
|
+ ;; export the file to html
|
|
|
|
+ (org-export-as-html nil))
|
|
;; should create a .html file
|
|
;; should create a .html file
|
|
- (should (file-exists-p (concat
|
|
|
|
- (file-name-sans-extension org-test-no-header-file)
|
|
|
|
- ".html")))
|
|
|
|
|
|
+ (should (file-exists-p html-file))
|
|
;; should not create a file with "::" appended to it's name
|
|
;; should not create a file with "::" appended to it's name
|
|
- (should-not (file-exists-p (concat org-test-no-header-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 ()
|
|
(ert-deftest test-ob-exp/org-babel-exp-src-blocks/w-no-file ()
|
|
"Testing export from buffers which are not visiting any file."
|
|
"Testing export from buffers which are not visiting any file."
|
|
@@ -39,10 +42,25 @@
|
|
;; should contain the content of the buffer
|
|
;; should contain the content of the buffer
|
|
(save-excursion
|
|
(save-excursion
|
|
(set-buffer (get-buffer "*Org HTML Export*"))
|
|
(set-buffer (get-buffer "*Org HTML Export*"))
|
|
- (should (string-match (regexp-quote test-org-code-block-anchor)
|
|
|
|
|
|
+ (should (string-match (regexp-quote org-test-file-ob-anchor)
|
|
(buffer-string))))
|
|
(buffer-string))))
|
|
(when (get-buffer "*Org HTML Export*") (kill-buffer "*Org HTML Export*")))
|
|
(when (get-buffer "*Org HTML Export*") (kill-buffer "*Org HTML Export*")))
|
|
|
|
|
|
|
|
+(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-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
|
|
|
|
+ ;; export the file to html
|
|
|
|
+ (org-export-as-html nil))
|
|
|
|
+ ;; should create a .html file
|
|
|
|
+ (should (file-exists-p html-file))
|
|
|
|
+ ;; should not create a file with "::" appended to it's name
|
|
|
|
+ (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)
|
|
(provide 'test-ob-exp)
|
|
|
|
|
|
;;; test-ob-exp.el ends here
|
|
;;; test-ob-exp.el ends here
|