-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathspec_test.go
46 lines (44 loc) · 1.1 KB
/
spec_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
package genus
import "testing"
func TestSpec_Save(t *testing.T) {
type fields struct {
Suffix string
TemplateDir string
BaseDir string
BasePackage string
SkipExists bool
SkipFormat bool
SkipFixImports bool
Merge bool
PlanItems []*PlanItem
Extension *SpecExtension
}
type args struct {
baseDir string
}
tests := []struct {
name string
fields fields
args args
wantErr bool
}{
{"OK", fields{}, args{"./_test"}, false},
}
for _, tt := range tests {
spec := &Spec{
Suffix: tt.fields.Suffix,
TemplateDir: tt.fields.TemplateDir,
BaseDir: tt.fields.BaseDir,
BasePackage: tt.fields.BasePackage,
SkipExists: tt.fields.SkipExists,
SkipFormat: tt.fields.SkipFormat,
SkipFixImports: tt.fields.SkipFixImports,
Merge: tt.fields.Merge,
PlanItems: tt.fields.PlanItems,
Extension: tt.fields.Extension,
}
if err := spec.Save(tt.args.baseDir); (err != nil) != tt.wantErr {
t.Errorf("%q. Spec.Save() error = %v, wantErr %v", tt.name, err, tt.wantErr)
}
}
}