summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/spf13/cobra/cobra/cmd/add_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/spf13/cobra/cobra/cmd/add_test.go')
-rw-r--r--vendor/github.com/spf13/cobra/cobra/cmd/add_test.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/add_test.go b/vendor/github.com/spf13/cobra/cobra/cmd/add_test.go
index dacbe838a..b920e2b9d 100644
--- a/vendor/github.com/spf13/cobra/cobra/cmd/add_test.go
+++ b/vendor/github.com/spf13/cobra/cobra/cmd/add_test.go
@@ -6,6 +6,8 @@ import (
"os"
"path/filepath"
"testing"
+
+ "github.com/spf13/viper"
)
// TestGoldenAddCmd initializes the project "github.com/spf13/testproject"
@@ -16,10 +18,17 @@ import (
func TestGoldenAddCmd(t *testing.T) {
projectName := "github.com/spf13/testproject"
project := NewProject(projectName)
+ defer os.RemoveAll(project.AbsPath())
- // Initialize the project at first.
+ 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)
+
+ // Initialize the project first.
initializeProject(project)
- defer os.RemoveAll(project.AbsPath())
// Then add the "test" command.
cmdName := "test"
@@ -48,7 +57,7 @@ func TestGoldenAddCmd(t *testing.T) {
goldenPath := filepath.Join("testdata", filepath.Base(path)+".golden")
switch relPath {
- // Know directories.
+ // Known directories.
case ".":
return nil
// Known files.