(rt http.RoundTripper, isTTY bool, cli string)
| 18 | ) |
| 19 | |
| 20 | func runCommand(rt http.RoundTripper, isTTY bool, cli string) (*test.CmdOut, error) { |
| 21 | ios, _, stdout, stderr := iostreams.Test() |
| 22 | ios.SetStdoutTTY(isTTY) |
| 23 | ios.SetStdinTTY(isTTY) |
| 24 | ios.SetStderrTTY(isTTY) |
| 25 | |
| 26 | factory := &cmdutil.Factory{ |
| 27 | IOStreams: ios, |
| 28 | HttpClient: func() (*http.Client, error) { |
| 29 | return &http.Client{Transport: rt}, nil |
| 30 | }, |
| 31 | Config: func() (gh.Config, error) { |
| 32 | return config.NewBlankConfig(), nil |
| 33 | }, |
| 34 | BaseRepo: func() (ghrepo.Interface, error) { |
| 35 | return ghrepo.New("OWNER", "REPO"), nil |
| 36 | }, |
| 37 | } |
| 38 | |
| 39 | cmd := NewCmdStatus(factory, nil) |
| 40 | |
| 41 | argv, err := shlex.Split(cli) |
| 42 | if err != nil { |
| 43 | return nil, err |
| 44 | } |
| 45 | cmd.SetArgs(argv) |
| 46 | |
| 47 | cmd.SetIn(&bytes.Buffer{}) |
| 48 | cmd.SetOut(io.Discard) |
| 49 | cmd.SetErr(io.Discard) |
| 50 | |
| 51 | _, err = cmd.ExecuteC() |
| 52 | return &test.CmdOut{ |
| 53 | OutBuf: stdout, |
| 54 | ErrBuf: stderr, |
| 55 | }, err |
| 56 | } |
| 57 | |
| 58 | func TestIssueStatus(t *testing.T) { |
| 59 | http := &httpmock.Registry{} |
no test coverage detected