summaryrefslogtreecommitdiff
path: root/test/lisp/auth-source-pass-tests.el
diff options
context:
space:
mode:
authorDamien Cassou <damien@cassou.me>2017-11-07 09:32:30 +0100
committerNicolas Petton <nicolas@petton.fr>2018-06-05 15:51:00 +0200
commit5b31e6de99d2c56ba61ea439b0b44862813d9480 (patch)
tree273d6636d27df2e4a1b889245a6e3290fefa9d64 /test/lisp/auth-source-pass-tests.el
parent53f044c22f9f94e7663b7343c5100904a68f6de5 (diff)
downloademacs-5b31e6de99d2c56ba61ea439b0b44862813d9480.tar.gz
Add a test to auth-source-pass-tests.el
* test/lisp/auth-source-pass-tests.el (auth-source-pass-build-result-passes-full-host-to-find-match): Add test making sure find-match is called with full host.
Diffstat (limited to 'test/lisp/auth-source-pass-tests.el')
-rw-r--r--test/lisp/auth-source-pass-tests.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/lisp/auth-source-pass-tests.el b/test/lisp/auth-source-pass-tests.el
index adb0b5d93fe..2ddbcab233c 100644
--- a/test/lisp/auth-source-pass-tests.el
+++ b/test/lisp/auth-source-pass-tests.el
@@ -204,6 +204,13 @@ This function is intended to be set to `auth-source-debug`."
(should (equal (plist-get result :port) 512))
(should (equal (plist-get result :user) "anuser")))))
+(ert-deftest auth-source-pass-build-result-passes-full-host-to-find-match ()
+ (let (passed-host)
+ (cl-letf (((symbol-function 'auth-source-pass--find-match)
+ (lambda (host _user) (setq passed-host host))))
+ (auth-source-pass--build-result "https://user@host.com:123" nil nil)
+ (should (equal passed-host "https://user@host.com:123")))))
+
(ert-deftest auth-source-pass-only-return-entries-that-can-be-open ()
(cl-letf (((symbol-function 'auth-source-pass-entries)
(lambda () '("foo.site.com" "bar.site.com" "mail/baz.site.com/scott")))