Skip to content

Commit

Permalink
Add tests for 'el-get-insecure-check-url
Browse files Browse the repository at this point in the history
  • Loading branch information
manandbytes committed Aug 30, 2016
1 parent 9ebd82b commit 00f6df9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/el-get-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,31 @@ Following variables are bound to temporal values:
(should-not (featurep pkg))
(el-get 'sync (mapcar 'el-get-source-name el-get-sources))
(should (featurep pkg)))))

(ert-deftest el-get-insecure-check-url-secure ()
(let ((el-get-allow-insecure nil))
(dolist (url '("https://example.com/"
"ssh://example.com/"
"user@ftp://example.com/"))
(should-not (el-get-insecure-check "ag" url)))))

(ert-deftest el-get-insecure-check-url-insecure ()
(let ((el-get-allow-insecure nil))
(dolist (url '("git+ssh://example.com/"
"bzr+ssh://example.com/"
"sftp://example.com/"
"http://example.com/"
":pserver:anonymous@cvs.namazu.org:/storage/cvsroot"
"ftp://user@example.com/"))
(should-error (el-get-insecure-check "ag" url)))))

;; TODO reuse URLs from secure/insecure tests
(ert-deftest el-get-insecure-check-url-allow-insecure ()
(let ((el-get-allow-insecure 't))
(dolist (url '("git+ssh://example.com/"
"bzr+ssh://example.com/"
"sftp://example.com/"
"http://example.com/"
":pserver:anonymous@cvs.namazu.org:/storage/cvsroot"
"ftp://user@example.com/"))
(should-not (el-get-insecure-check "ag" url)))))

0 comments on commit 00f6df9

Please sign in to comment.