mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
test changes to make it pass
This commit is contained in:
parent
45b377d6b1
commit
5513220bc3
1 changed files with 11 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue