make edit respect --save-config

This commit is contained in:
ymqytw
2017-02-27 09:47:26 -08:00
parent 77733c2afd
commit 1cebb2c1bb
17 changed files with 369 additions and 5 deletions

View File

@@ -49,6 +49,7 @@ type EditTestCase struct {
Args []string `yaml:"args"`
Filename string `yaml:"filename"`
Output string `yaml:"outputFormat"`
SaveConfig string `yaml:"saveConfig"`
Namespace string `yaml:"namespace"`
ExpectedStdout []string `yaml:"expectedStdout"`
ExpectedStderr []string `yaml:"expectedStderr"`
@@ -247,6 +248,9 @@ func TestEdit(t *testing.T) {
if len(testcase.Output) > 0 {
cmd.Flags().Set("output", testcase.Output)
}
if len(testcase.SaveConfig) > 0 {
cmd.Flags().Set("save-config", testcase.SaveConfig)
}
cmdutil.BehaviorOnFatal(func(str string, code int) {
errBuf.WriteString(str)