test-property-inheritance.el 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ;;; test-ob-R.el --- tests for ob-R.el
  2. ;; Copyright (c) 2011-2014 Eric Schulte
  3. ;; Authors: Eric Schulte
  4. ;; This file is not part of GNU Emacs.
  5. ;; This program is free software; you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; This program is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Code:
  16. (defmacro test-org-in-property-buffer (&rest body)
  17. `(with-temp-buffer
  18. (insert-file-contents (expand-file-name "property-inheritance.org"
  19. org-test-example-dir))
  20. (org-mode)
  21. ,@body))
  22. (def-edebug-spec test-org-in-property-buffer (body))
  23. (ert-deftest test-org-property-accumulation-top-use ()
  24. (test-org-in-property-buffer
  25. (goto-char (point-min))
  26. (org-babel-next-src-block 1)
  27. (should (equal 3 (org-babel-execute-src-block)))))
  28. (ert-deftest test-org-property-accumulation-overwrite-use ()
  29. (test-org-in-property-buffer
  30. (goto-char (point-min))
  31. (org-babel-next-src-block 2)
  32. (should (= 7 (org-babel-execute-src-block)))))
  33. (ert-deftest test-org-property-accumulation-append-use ()
  34. (test-org-in-property-buffer
  35. (goto-char (point-min))
  36. (org-babel-next-src-block 3)
  37. (should (= 6 (org-babel-execute-src-block)))))
  38. (provide 'test-ob-R)
  39. ;;; test-ob-R.el ends here