-
Notifications
You must be signed in to change notification settings - Fork 51
/
git_test.go
34 lines (26 loc) · 1.03 KB
/
git_test.go
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
29
30
31
32
33
34
package captain // import "github.com/harbur/captain"
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGitGetRevision(t *testing.T) {
assert.Equal(t, 7, len(getRevision(false)), "Git revision should have length 7 chars")
}
func TestGitGetRevisionFullSha(t *testing.T) {
assert.Equal(t, 40, len(getRevision(true)), "Git revision should have a length of 40 chars")
}
// TODO Fails because it assumes current branch is master
func TestGitGetBranch(t *testing.T) {
// assert.Equal(t, []string{"master"}, getBranches(false), "Git branch should be master")
}
// TODO Fails because it assumes current branch is master
func TestGitGetBranchAllBranches(t *testing.T) {
// assert.Equal(t, []string{"master"}, getBranches(true), "Git branch should be master")
}
// TODO Fails because vendors/ is not git-ignored.
func TestGitIsDirty(t *testing.T) {
// assert.Equal(t, false, isDirty(), "Git should not have local changes")
}
func TestGitIsGit(t *testing.T) {
assert.Equal(t, true, isGit(), "There should be a git repository")
}