config_edit_test.go 673 字节
Newer Older
1 2
package cmd

3 4 5 6 7 8 9 10 11 12 13 14
//func TestEditConfig(t *testing.T) {
//	RunEditCommandTest(t, EditCommandTest{
//		Procedure: func(c *expect.Console) {
//			c.ExpectString("Edit config item yourServer")
//			c.SendLine("")
//			go c.ExpectEOF()
//			time.Sleep(time.Millisecond)
//			c.Send("\x1b")
//			c.SendLine(":wq!")
//		},
//		Test: func(stdio terminal.Stdio) (err error) {
//			rootOptions.ConfigFile = "test.yaml"
LinuxSuRen's avatar
LinuxSuRen 已提交
15
//			data, err := GenerateSampleConfig()
16 17 18 19 20 21 22 23 24
//			err = ioutil.WriteFile(rootOptions.ConfigFile, data, 0664)
//
//			rootCmd.SetArgs([]string{"config", "edit"})
//			configEditOption.CommonOption.Stdio = stdio
//			_, err = rootCmd.ExecuteC()
//			return
//		},
//	})
//}