test changes to make it pass

This commit is contained in:
Viktor Benei 2016-07-04 21:49:06 +02:00
parent 45b377d6b1
commit 5513220bc3

View file

@ -934,6 +934,11 @@ func TestRootSuggestions(t *testing.T) {
cmd := initializeWithRootCmd() cmd := initializeWithRootCmd()
cmd.AddCommand(cmdTimes) cmd.AddCommand(cmdTimes)
origCmdRun := cmd.Run
defer func() {
cmd.Run = origCmdRun
}()
cmd.Run = nil
tests := map[string]string{ tests := map[string]string{
"time": "times", "time": "times",
@ -1024,6 +1029,12 @@ func TestFlagsBeforeCommand(t *testing.T) {
func TestRemoveCommand(t *testing.T) { func TestRemoveCommand(t *testing.T) {
versionUsed = 0 versionUsed = 0
c := initializeWithRootCmd() c := initializeWithRootCmd()
origCmdRun := c.Run
defer func() {
c.Run = origCmdRun
}()
c.Run = nil
c.AddCommand(cmdVersion1) c.AddCommand(cmdVersion1)
c.RemoveCommand(cmdVersion1) c.RemoveCommand(cmdVersion1)
x := fullTester(c, "version") x := fullTester(c, "version")