emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole 733c4f9833 1/7: Add test for gbut:act on a we


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 733c4f9833 1/7: Add test for gbut:act on a web link
Date: Mon, 15 Apr 2024 06:58:13 -0400 (EDT)

branch: externals/hyperbole
commit 733c4f983322f93e25f7f71ab5163f70e2e07cb2
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: Mats Lidell <mats.lidell@lidells.se>

    Add test for gbut:act on a web link
---
 ChangeLog          |  5 +++++
 test/hbut-tests.el | 15 ++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 68c46e4012..2f18b37e28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-04-14  Mats Lidell  <matsl@gnu.org>
+
+* test/hbut-tests.el (hypb--gbut-act-with-web-link): Test for gbut:act
+    on a web link.
+
 2024-04-14  Bob Weiner  <rsw@gnu.org>
 
 * hbut.el (ibut:create): Set 'name-start' and 'name-end' location attributes
diff --git a/test/hbut-tests.el b/test/hbut-tests.el
index d5f58d8e50..3974b03861 100644
--- a/test/hbut-tests.el
+++ b/test/hbut-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    30-may-21 at 09:33:00
-;; Last-Mod:     16-Mar-24 at 23:44:27 by Mats Lidell
+;; Last-Mod:     10-Apr-24 at 16:25:30 by Mats Lidell
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -780,6 +780,19 @@ See #10 for the proper way to add an ibutton name.
     (goto-char 8)  ;; ibtypes::mail-address !!
     (should (equal (hattr:get (ibut:at-p) 'categ) 'ibtypes::pathname))))
 
+(ert-deftest hypb--gbut-act-with-web-link ()
+  "Verify `gbut:act' with a web link calls browser."
+  :expected-result :failed
+  (defvar global-but-file)
+  (let ((global-but-file (make-temp-file "gbut" nil ".txt"
+                                         "<[Link]> - 
\"https://savannah.gnu.org/projects/hyperbole/\"\n";)))
+    (unwind-protect
+        (mocklet ((gbut:file => global-but-file)
+                  ((browse-url "https://savannah.gnu.org/projects/hyperbole/"; 
nil) => t)
+                  (hpath:find-noselect => (find-file-noselect 
global-but-file)))
+          (gbut:act "Link"))
+      (hy-delete-file-and-buffer global-but-file))))
+
 ;; This file can't be byte-compiled without the `el-mock' package (because of
 ;; the use of the `with-mock' macro), which is not a dependency of Hyperbole.
 ;;  Local Variables:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]