diff options
Diffstat (limited to 'vendor/github.com/spf13/cobra/cobra/cmd/init_test.go')
-rw-r--r-- | vendor/github.com/spf13/cobra/cobra/cmd/init_test.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/init_test.go b/vendor/github.com/spf13/cobra/cobra/cmd/init_test.go index 9a918b9b4..40eb4038e 100644 --- a/vendor/github.com/spf13/cobra/cobra/cmd/init_test.go +++ b/vendor/github.com/spf13/cobra/cobra/cmd/init_test.go @@ -6,6 +6,8 @@ import ( "os" "path/filepath" "testing" + + "github.com/spf13/viper" ) // TestGoldenInitCmd initializes the project "github.com/spf13/testproject" @@ -17,6 +19,13 @@ func TestGoldenInitCmd(t *testing.T) { project := NewProject(projectName) defer os.RemoveAll(project.AbsPath()) + viper.Set("author", "NAME HERE <EMAIL ADDRESS>") + viper.Set("license", "apache") + viper.Set("year", 2017) + defer viper.Set("author", nil) + defer viper.Set("license", nil) + defer viper.Set("year", nil) + os.Args = []string{"cobra", "init", projectName} if err := rootCmd.Execute(); err != nil { t.Fatal("Error by execution:", err) @@ -44,7 +53,7 @@ func TestGoldenInitCmd(t *testing.T) { goldenPath := filepath.Join("testdata", filepath.Base(path)+".golden") switch relPath { - // Know directories. + // Known directories. case ".", "cmd": return nil // Known files. |