forked from zweifisch/ob-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.el
22 lines (18 loc) · 798 Bytes
/
tests.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(require 'ob-http)
(ert-deftest ob-http-test-construct-url ()
(let ((params '((:username . "demo")
(:password . "secret")
(:host . "localhost"))))
(should (equal (ob-http-construct-url "/" params)
"http://demo:secret@localhost/")))
(let ((params '((:host . "localhost"))))
(should (equal (ob-http-construct-url "/" params)
"http://localhost/")))
(let ((params '((:host . "localhost"))))
(should (equal (ob-http-construct-url "http://local" params)
"http://local")))
(let ((params '((:host . "localhost")
(:port . 8080)
(:scheme . "https"))))
(should (equal (ob-http-construct-url "/" params)
"https://localhost:8080/"))))