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

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

[nongnu] elpa/webpaste 6b93c89 153/298: Merge branch 'naclander-master'


From: ELPA Syncer
Subject: [nongnu] elpa/webpaste 6b93c89 153/298: Merge branch 'naclander-master'
Date: Thu, 9 Dec 2021 19:00:04 -0500 (EST)

branch: elpa/webpaste
commit 6b93c89cbc500da8a3cef969df9fa3864d5495a3
Merge: 29d10d7 410e286
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>

    Merge branch 'naclander-master'
---
 test/webpaste-test.el | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/test/webpaste-test.el b/test/webpaste-test.el
index 056735a..7a0f0ec 100644
--- a/test/webpaste-test.el
+++ b/test/webpaste-test.el
@@ -63,7 +63,26 @@
       ;; Test so webpaste-paste-region selects the same part of the buffer as 
to
       ;; be expected.
       (should (equal (webpaste-paste-region 10 100)
-                     (buffer-substring 10 100))))))
+                     (buffer-substring 10 100)))
+
+      ;; Test when wanting a paste confirmation
+      (let ((webpaste/paste-confirmation t))
+
+        ;; Override yes-or-no-p to immitate "yes" response
+        (cl-letf (((symbol-function 'yes-or-no-p) (lambda (text) t)))
+
+          (should (equal (webpaste-paste-buffer) (buffer-string)))
+
+          (should (equal (webpaste-paste-region 10 100)
+                         (buffer-substring 10 100))))
+
+        ;; Override yes-or-no-p to immitate "no" response
+        (cl-letf (((symbol-function 'yes-or-no-p) (lambda (text) nil)))
+
+          (should (not (equal (webpaste-paste-buffer) (buffer-string))))
+
+          (should (not (equal (webpaste-paste-region 10 100)
+                                 (buffer-substring 10 100)))))))))
 
 
 



reply via email to

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