(httpClient *http.Client, cli string)
| 112 | } |
| 113 | |
| 114 | func runCloneCommand(httpClient *http.Client, cli string) (*test.CmdOut, error) { |
| 115 | ios, stdin, stdout, stderr := iostreams.Test() |
| 116 | fac := &cmdutil.Factory{ |
| 117 | IOStreams: ios, |
| 118 | HttpClient: func() (*http.Client, error) { |
| 119 | return httpClient, nil |
| 120 | }, |
| 121 | Config: func() (gh.Config, error) { |
| 122 | return config.NewBlankConfig(), nil |
| 123 | }, |
| 124 | GitClient: &git.Client{ |
| 125 | GhPath: "some/path/gh", |
| 126 | GitPath: "some/path/git", |
| 127 | }, |
| 128 | } |
| 129 | |
| 130 | cmd := NewCmdClone(fac, nil) |
| 131 | |
| 132 | argv, err := shlex.Split(cli) |
| 133 | cmd.SetArgs(argv) |
| 134 | |
| 135 | cmd.SetIn(stdin) |
| 136 | cmd.SetOut(stderr) |
| 137 | cmd.SetErr(stderr) |
| 138 | |
| 139 | if err != nil { |
| 140 | panic(err) |
| 141 | } |
| 142 | |
| 143 | _, err = cmd.ExecuteC() |
| 144 | |
| 145 | if err != nil { |
| 146 | return nil, err |
| 147 | } |
| 148 | |
| 149 | return &test.CmdOut{OutBuf: stdout, ErrBuf: stderr}, nil |
| 150 | } |
| 151 | |
| 152 | func Test_RepoClone(t *testing.T) { |
| 153 | tests := []struct { |
no test coverage detected