Skip to content

Commit

Permalink
remove old test. add new test.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicferrier committed Oct 12, 2014
1 parent 639aeb2 commit e7630f5
Showing 1 changed file with 17 additions and 27 deletions.
44 changes: 17 additions & 27 deletions org-email-tests.el
Expand Up @@ -3,33 +3,23 @@
(require 'ert)
(require 'org-email)

(ert-deftest org-email-test-structure ()
"Tests that the expected structure can be navigated properly."
(with-temp-buffer
(insert "* bill the buck
** email
*** billbuck@example1.com
** partner
*** Gillie The Girl
* lesley lady
** colleague @ woomedia
*** CSS programmer
** partner
*** Jimmy Screws
** email
*** ll@example10.org")
(org-mode)
;; Have we got the basics right?
(save-excursion
(goto-char (point-min))
(should (equal "* bill the buck"
(buffer-substring-no-properties (point-min)(line-end-position)))))
;; Now pull the emails and check two
(let* ((emails (org-email--buffer-emails (current-buffer)))
(bill (assoc "bill the buck" emails))
(lesley (assoc "lesley lady" emails)))
(should (equal "billbuck@example1.com" (cdr bill)))
(should (equal "ll@example10.org" (cdr lesley))))))
(defconst org-email-tests-dir
(file-name-directory
(or (buffer-file-name)
load-file-name
default-directory)))

(ert-deftest org-email-lists ()
"Test the parsing of org files with emails."
(should
(equal
(org-email-list
(expand-file-name "test.org" org-email-tests-dir))
'(("nic ferrier" . "nic@ferrier.me.uk")
("J Love" . "j.luv@somemail.com")
("Bob Towney" . "B.towney@digital.place.email.uk")
("Some Guy" . "guy@some.org")))))



;;; org-email-tests.el ends here

0 comments on commit e7630f5

Please sign in to comment.