-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathfixures.go
49 lines (40 loc) · 1002 Bytes
/
fixures.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
package fixtures
import "testing"
type cmdArgs func(dir string) []string
type setup func(dir string) error
type assertion func(dir string, actualOutput string, t *testing.T) bool
type teardown func(dir string) error
//Test represents all the necessary information to run the test case
type Test struct {
Feature string
Name string
CmdArgs cmdArgs
Setup setup
Assertion assertion
Teardown teardown
}
// GetFixtures returns all the fixtures to be tested
func GetFixtures() []Test {
routes := [][]Test{
featureRootTestData(),
featureExecuteCmdTestData(),
featureInitTestsData(),
featureListTestData(),
featureSetTestsData(),
featureUnsetTestsData(),
featureFlagVersionTestData(),
featureFlagTestData(),
featureDeleteTestData(),
}
var r1 []Test
for _, r := range routes {
r1 = append(r1, r...)
}
return r1
}
// Args returns argument function
func Args(args ...string) func(dir string) []string {
return func(dir string) []string {
return args
}
}