From 5513220bc3d99d258948b1094b864892f256c249 Mon Sep 17 00:00:00 2001 From: Viktor Benei Date: Mon, 4 Jul 2016 21:49:06 +0200 Subject: [PATCH] test changes to make it pass --- cobra_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cobra_test.go b/cobra_test.go index 97090b10..a7d1744e 100644 --- a/cobra_test.go +++ b/cobra_test.go @@ -934,6 +934,11 @@ func TestRootSuggestions(t *testing.T) { cmd := initializeWithRootCmd() cmd.AddCommand(cmdTimes) + origCmdRun := cmd.Run + defer func() { + cmd.Run = origCmdRun + }() + cmd.Run = nil tests := map[string]string{ "time": "times", @@ -1024,6 +1029,12 @@ func TestFlagsBeforeCommand(t *testing.T) { func TestRemoveCommand(t *testing.T) { versionUsed = 0 c := initializeWithRootCmd() + origCmdRun := c.Run + defer func() { + c.Run = origCmdRun + }() + c.Run = nil + c.AddCommand(cmdVersion1) c.RemoveCommand(cmdVersion1) x := fullTester(c, "version")