Skip to content

Commit bb36f09

Browse files
author
Jason Duncan
committed
More test coverage.
1 parent c1170a6 commit bb36f09

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/dashboard-project-status-test.el

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,16 @@
109109
(insert (car (last args)))))
110110
(dashboard-project-status-insert-body)))
111111
(buffer-string)))
112+
(desc "dashboard-project-status-git-local-is-behind? returns non nil when branch is behind")
113+
(expect t
114+
(mock (git-run "status" "-uno") => "Your branch is behind")
115+
(dashboard-project-status-git-local-is-behind?))
116+
(desc "dashboard-project-status-git-local-is-behind? returns nil when branch is not behind")
117+
(expect nil
118+
(mock (git-run "status" "-uno") => "")
119+
(dashboard-project-status-git-local-is-behind?))
120+
(desc "dashboard-project-status-git-unstaged-files returns a list of unstaged files")
121+
(expect '("foo" "bar")
122+
(mock (git-run "diff" "--name-only") => "foo\nbar")
123+
(dashboard-project-status-git-unstaged-files))
112124
)

0 commit comments

Comments
 (0)