MCPcopy
hub / github.com/cli/cli / TestNewCmdRerun

Function TestNewCmdRerun

pkg/cmd/run/rerun/rerun_test.go:22–164  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20)
21
22func TestNewCmdRerun(t *testing.T) {
23 tests := []struct {
24 name string
25 cli string
26 tty bool
27 wants RerunOptions
28 wantsErr bool
29 }{
30 {
31 name: "blank nontty",
32 wantsErr: true,
33 },
34 {
35 name: "blank tty",
36 tty: true,
37 wants: RerunOptions{
38 Prompt: true,
39 },
40 },
41 {
42 name: "with arg nontty",
43 cli: "1234",
44 wants: RerunOptions{
45 RunID: "1234",
46 },
47 },
48 {
49 name: "with arg tty",
50 tty: true,
51 cli: "1234",
52 wants: RerunOptions{
53 RunID: "1234",
54 },
55 },
56 {
57 name: "failed arg nontty",
58 cli: "4321 --failed",
59 wants: RerunOptions{
60 RunID: "4321",
61 OnlyFailed: true,
62 },
63 },
64 {
65 name: "failed arg",
66 tty: true,
67 cli: "--failed",
68 wants: RerunOptions{
69 Prompt: true,
70 OnlyFailed: true,
71 },
72 },
73 {
74 name: "with arg job",
75 tty: true,
76 cli: "--job 1234",
77 wants: RerunOptions{
78 JobID: "1234",
79 },

Callers

nothing calls this directly

Calls 7

TestFunction · 0.92
NewCmdRerunFunction · 0.85
SetStdinTTYMethod · 0.80
SetStdoutTTYMethod · 0.80
EqualMethod · 0.80
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected