forked from syl20bnr/spacemacs
/
spacemacs-mode-test.el
28 lines (24 loc) · 1.19 KB
/
spacemacs-mode-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
27
28
(load-file "../init.el")
(load-file "test/lib/mocker.el")
(ert-deftest assertion-library-should-work ()
"the assertion library should works"
(mocker-let ((foo (n)
((:input '(1) :output 1)))
(bar (n m)
((:input '(2 2) :output 2))))
(should (equal (foo 1) 1))
(should (equal (bar 2 2) 2))))
(ert-deftest git-has-remote ()
(should (equal (spacemacs/git-has-remote "clearly-not-a-R3M0T3!") nil))
(should (numberp (spacemacs/git-has-remote "origin"))))
(ert-deftest git-fetch-tags ()
(mocker-let ((process-file (git infile buffer display action &rest args)
:ordered nil
((:input '("git" nil "git-fetch-tags" nil "fetch" "--tags" "origin" "master")
:output 0)
(:input '("git" nil "git-fetch-tags" nil "fetch" "origin" "master")
:output 0)))
(kill-buffer (buffer)
((:input '("git-fetch-tags")
:output 0))))
(should (equal (spacemacs/git-fetch-tags "origin" "master") t))))