(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestNewCmdView(t *testing.T) { |
| 61 | // Test shared parsing of issue number / URL. |
| 62 | argparsetest.TestArgParsing(t, NewCmdView) |
| 63 | |
| 64 | t.Run("comments and JSON are mutually exclusive", func(t *testing.T) { |
| 65 | cmd := NewCmdView(&cmdutil.Factory{}, func(*ViewOptions) error { |
| 66 | return nil |
| 67 | }) |
| 68 | cmd.SetArgs([]string{"123", "--comments", "--json", "number"}) |
| 69 | cmd.SetOut(io.Discard) |
| 70 | cmd.SetErr(io.Discard) |
| 71 | |
| 72 | _, err := cmd.ExecuteC() |
| 73 | require.EqualError(t, err, "specify only one of --comments or --json") |
| 74 | }) |
| 75 | } |
| 76 | |
| 77 | func runCommand(rt http.RoundTripper, isTTY bool, cli string) (*test.CmdOut, error) { |
| 78 | ios, _, stdout, stderr := iostreams.Test() |
nothing calls this directly
no test coverage detected