From b26b538f693051ac6518e65672de3144ce3fbedc Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Mon, 31 Jul 2017 11:04:27 -0600 Subject: [PATCH] Fix remaining reproducibility in TestGoldenAddCmd My previous fix in PR #504 was incomplete. Fixes #503 --- cobra/cmd/add_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cobra/cmd/add_test.go b/cobra/cmd/add_test.go index 0c46bc5..b920e2b 100644 --- a/cobra/cmd/add_test.go +++ b/cobra/cmd/add_test.go @@ -18,9 +18,6 @@ import ( func TestGoldenAddCmd(t *testing.T) { projectName := "github.com/spf13/testproject" project := NewProject(projectName) - - // Initialize the project at first. - initializeProject(project) defer os.RemoveAll(project.AbsPath()) viper.Set("author", "NAME HERE ") @@ -30,6 +27,9 @@ func TestGoldenAddCmd(t *testing.T) { defer viper.Set("license", nil) defer viper.Set("year", nil) + // Initialize the project first. + initializeProject(project) + // Then add the "test" command. cmdName := "test" cmdPath := filepath.Join(project.CmdPath(), cmdName+".go")