-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdirectoryService_test.go
58 lines (42 loc) · 1.18 KB
/
directoryService_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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main
import (
"testing"
. "github.com/franela/goblin"
)
func Test_DirectoryService(t *testing.T) {
g := Goblin(t)
g.Describe("Directory Service", func() {
g.It("should return the directories in the current project directory", func() {
path := "."
directories := GetDirectoriesInPath(path)
actual := len(directories) > 0
g.Assert(actual).Equal(true)
})
g.It("should return 'vendor' as one of the directories in the current path", func() {
path := "."
expectedDirectory := "vendor"
containsDirectory := false
directories := GetDirectoriesInPath(path)
for _, directory := range directories {
if directory == expectedDirectory {
containsDirectory = true
}
}
actual := containsDirectory
g.Assert(actual).Equal(true)
})
g.It("should return '.git' as one of the directories in the current path", func() {
path := "."
expectedDirectory := ".git"
containsDirectory := false
directories := GetDirectoriesInPath(path)
for _, directory := range directories {
if directory == expectedDirectory {
containsDirectory = true
}
}
actual := containsDirectory
g.Assert(actual).Equal(true)
})
})
}