-
Notifications
You must be signed in to change notification settings - Fork 5
/
pushbullet-test.el
26 lines (24 loc) · 1.03 KB
/
pushbullet-test.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(require 'ert)
(require 'pushbullet)
(ert-deftest pb/json-extract ()
(let ((json-object-type 'alist)
(devices-json "{
\"devices\":[
{
\"iden\":19137,
\"extras\":{
\"manufacturer\":\"samsung\",
\"model\":\"Galaxy Nexus\",
\"android_version\":\"4.1.1\",
\"sdk_version\":\"16\",
\"app_version\":\"8\",
\"nickname\":\"Galaxy Nexus\"
}
}
]
}"))
(should (equal '(19137) (pb/json-extract 'iden 'devices devices-json)))))
(ert-deftest pushbullet-clear-devices ()
(setq pb/device-ids '(123))
(pushbullet-clear-devices)
(should (equal nil pb/device-ids)))