diff options
author | Kyle Meyer <kyle@kyleam.com> | 2014-02-15 15:04:49 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2014-02-15 15:04:49 -0500 |
commit | 9f58e9ba0d43f7bda3c07a493b1f5f4d146976e3 (patch) | |
tree | 6e29b6dc738eed284ce8af0a6fcc29c6129b2b38 /bog-tests.el | |
parent | 46cc689116e384cf7eb6a780ce9026ce57cd5964 (diff) | |
download | bog-9f58e9ba0d43f7bda3c07a493b1f5f4d146976e3.tar.gz |
ENH: Remove bog-citekey-action
`bog-citekey-action' generalizes the common setup (citekey selection
from notes or from user completion) of the citekey functions, but it
doesn't allow much flexibility for functions to handle citekey selection
differently. Replacing this with `bog-citekey-from-notes' shares the
citekey selection from notes but doesn't couple this to the user
selection.
Diffstat (limited to 'bog-tests.el')
-rw-r--r-- | bog-tests.el | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/bog-tests.el b/bog-tests.el index 6f64593..48da709 100644 --- a/bog-tests.el +++ b/bog-tests.el @@ -110,44 +110,32 @@ ;; `bog-citekey-action' -(ert-deftest bog-citekey-action-on-heading () - (let ((citekey "name2010word") - (action '(lambda (ck) ck))) +(ert-deftest bog-citekey-from-notes-on-heading () + (let ((citekey "name2010word")) (with-temp-buffer (insert (format "\n* top level\n\n** %s\n\nsome text\n" citekey)) (org-mode) (show-all) (re-search-backward bog-citekey-format) - (should (equal (bog-citekey-action action nil nil) citekey))))) + (should (equal (bog-citekey-from-notes) citekey))))) -(ert-deftest bog-citekey-action-on-in-text-citekey () - (let ((citekey "name2010word") - (action '(lambda (ck) ck))) +(ert-deftest bog-citekey-from-notes-on-in-text-citekey () + (let ((citekey "name2010word")) (with-temp-buffer (insert (format "\n* top level\n\n** other2000key\n\nsome text and %s\n" citekey)) (org-mode) (show-all) (re-search-backward bog-citekey-format) - (should (equal (bog-citekey-action action nil nil) citekey))))) + (should (equal (bog-citekey-from-notes) citekey))))) -(ert-deftest bog-citekey-action-no-citekey () +(ert-deftest bog-citekey-from-notes-no-citekey () (with-temp-buffer (insert "\n* top level\n\n** second\n\n") (org-mode) (show-all) - (should-error (bog-citekey-action nil nil nil)))) - -(ert-deftest bog-citekey-action-askfunc () - (let* ((citekey "name2010word") - (ask-func '(lambda () citekey)) - (action '(lambda (ck) ck))) - (with-temp-buffer - (insert "\n* top level\n\n** second\n\n") - (org-mode) - (show-all) - (should (equal (bog-citekey-action action ask-func t) citekey))))) + (should-error (bog-citekey-from-notes)))) ;;; BibTeX functions |