File tree Expand file tree Collapse file tree 2 files changed +12
-21
lines changed
Expand file tree Collapse file tree 2 files changed +12
-21
lines changed Original file line number Diff line number Diff line change @@ -12,20 +12,10 @@ func TestGoldenAddCmd(t *testing.T) {
1212 command := & Command {
1313 CmdName : "test" ,
1414 CmdParent : parentName ,
15- Project : & Project {
16- AbsolutePath : fmt .Sprintf ("%s/testproject" , wd ),
17- Legal : getLicense (),
18- Copyright : copyrightLine (),
19-
20- // required to init
21- AppName : "testproject" ,
22- PkgName : "github.com/spf13/testproject" ,
23- Viper : true ,
24- },
15+ Project : getProject (),
2516 }
2617 defer os .RemoveAll (command .AbsolutePath )
2718
28- // init project first
2919 command .Project .Create ()
3020 if err := command .Create (); err != nil {
3121 t .Fatal (err )
Original file line number Diff line number Diff line change @@ -7,22 +7,23 @@ import (
77 "testing"
88)
99
10- func TestGoldenInitCmd (t * testing.T ) {
11-
12- wd , _ := os .Getwd ()
13- project := & Project {
10+ func getProject () (* Project ) {
11+ return & Project {
1412 AbsolutePath : fmt .Sprintf ("%s/testproject" , wd ),
1513 Legal : getLicense (),
1614 Copyright : copyrightLine (),
17-
18- // required to init
19- AppName : "testproject" ,
20- PkgName : "github.com/spf13/testproject" ,
21- Viper : true ,
15+ AppName : "testproject" ,
16+ PkgName : "github.com/spf13/testproject" ,
17+ Viper : true ,
2218 }
19+ }
20+
21+ func TestGoldenInitCmd (t * testing.T ) {
22+
23+ wd , _ := os .Getwd ()
24+ project := getProject ()
2325 defer os .RemoveAll (project .AbsolutePath )
2426
25- // init project first
2627 err := project .Create ()
2728 if err != nil {
2829 t .Fatal (err )
You can’t perform that action at this time.
0 commit comments