mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
Fix remaining reproducibility in TestGoldenAddCmd
My previous fix in PR #504 was incomplete. Fixes #503
This commit is contained in:
parent
3da102d464
commit
b26b538f69
1 changed files with 3 additions and 3 deletions
|
@ -18,9 +18,6 @@ import (
|
||||||
func TestGoldenAddCmd(t *testing.T) {
|
func TestGoldenAddCmd(t *testing.T) {
|
||||||
projectName := "github.com/spf13/testproject"
|
projectName := "github.com/spf13/testproject"
|
||||||
project := NewProject(projectName)
|
project := NewProject(projectName)
|
||||||
|
|
||||||
// Initialize the project at first.
|
|
||||||
initializeProject(project)
|
|
||||||
defer os.RemoveAll(project.AbsPath())
|
defer os.RemoveAll(project.AbsPath())
|
||||||
|
|
||||||
viper.Set("author", "NAME HERE <EMAIL ADDRESS>")
|
viper.Set("author", "NAME HERE <EMAIL ADDRESS>")
|
||||||
|
@ -30,6 +27,9 @@ func TestGoldenAddCmd(t *testing.T) {
|
||||||
defer viper.Set("license", nil)
|
defer viper.Set("license", nil)
|
||||||
defer viper.Set("year", nil)
|
defer viper.Set("year", nil)
|
||||||
|
|
||||||
|
// Initialize the project first.
|
||||||
|
initializeProject(project)
|
||||||
|
|
||||||
// Then add the "test" command.
|
// Then add the "test" command.
|
||||||
cmdName := "test"
|
cmdName := "test"
|
||||||
cmdPath := filepath.Join(project.CmdPath(), cmdName+".go")
|
cmdPath := filepath.Join(project.CmdPath(), cmdName+".go")
|
||||||
|
|
Loading…
Reference in a new issue