aboutsummaryrefslogtreecommitdiff
path: root/test-org-link-edit.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2019-01-24 19:59:26 -0500
committerKyle Meyer <kyle@kyleam.com>2019-01-24 20:01:42 -0500
commit9f0209543318c331c5a4051750ea817370d234f6 (patch)
treeaacc6eafc5442388bc11a4565666bcfcf8230da6 /test-org-link-edit.el
parentd6019ec351d123b4b4f499d18068b72a187fafe6 (diff)
downloadorg-link-edit-9f0209543318c331c5a4051750ea817370d234f6.tar.gz
transport: Let caller overwrite previous description
The existing description may not be of interest to the caller, especially if it was automatically generated by org-store-link.
Diffstat (limited to 'test-org-link-edit.el')
-rw-r--r--test-org-link-edit.el18
1 files changed, 16 insertions, 2 deletions
diff --git a/test-org-link-edit.el b/test-org-link-edit.el
index 0980aca..0f63306 100644
--- a/test-org-link-edit.el
+++ b/test-org-link-edit.el
@@ -578,12 +578,26 @@ website"
(org-link-edit-transport-next-link
nil (point-min) (point)))
:type 'user-error)
- ;; Fail if link already has a description.
+ ;; Fail if link already has a description, unless caller confirms
+ ;; the overwrite.
+ (should-error
+ (org-test-with-temp-text
+ "Here is <point>Org's website \[\[http://orgmode.org/\]\[description\]\]"
+ (cl-letf (((symbol-function 'y-or-n-p) (lambda (_) nil)))
+ (call-interactively #'org-link-edit-transport-next-link)))
+ :type 'user-error)
(should-error
(org-test-with-temp-text
"Here is <point>Org's website \[\[http://orgmode.org/\]\[description\]\]"
(org-link-edit-transport-next-link))
- :type 'user-error))
+ :type 'user-error)
+ (should
+ (string=
+ "Here is \[\[http://orgmode.org/\]\[Org's\]\] website "
+ (org-test-with-temp-text
+ "Here is <point>Org's website \[\[http://orgmode.org/\]\[description\]\]"
+ (org-link-edit-transport-next-link nil nil nil 'overwrite)
+ (buffer-string)))))
;;; Other