MCPcopy
hub / github.com/cli/cli / TestListRun

Function TestListRun

pkg/cmd/repo/gitignore/list/list_test.go:65–190  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestListRun(t *testing.T) {
66 tests := []struct {
67 name string
68 opts *ListOptions
69 isTTY bool
70 httpStubs func(t *testing.T, reg *httpmock.Registry)
71 wantStdout string
72 wantStderr string
73 wantErr bool
74 errMsg string
75 }{
76 {
77 name: "gitignore list tty",
78 isTTY: true,
79 httpStubs: func(t *testing.T, reg *httpmock.Registry) {
80 reg.Register(
81 httpmock.REST("GET", "gitignore/templates"),
82 httpmock.StringResponse(`[
83 "AL",
84 "Actionscript",
85 "Ada",
86 "Agda",
87 "Android",
88 "AppEngine",
89 "AppceleratorTitanium",
90 "ArchLinuxPackages",
91 "Autotools",
92 "Ballerina",
93 "C",
94 "C++",
95 "CFWheels",
96 "CMake",
97 "CUDA",
98 "CakePHP",
99 "ChefCookbook",
100 "Clojure",
101 "CodeIgniter",
102 "CommonLisp",
103 "Composer",
104 "Concrete5",
105 "Coq",
106 "CraftCMS",
107 "D"
108 ]`,
109 ))
110 },
111 wantStdout: heredoc.Doc(`
112 GITIGNORE
113 AL
114 Actionscript
115 Ada
116 Agda
117 Android
118 AppEngine
119 AppceleratorTitanium
120 ArchLinuxPackages
121 Autotools
122 Ballerina

Callers

nothing calls this directly

Calls 14

RegisterMethod · 0.95
VerifyMethod · 0.95
RESTFunction · 0.92
StringResponseFunction · 0.92
NewBlankConfigFunction · 0.92
TestFunction · 0.92
SetStdoutTTYMethod · 0.80
SetStdinTTYMethod · 0.80
SetStderrTTYMethod · 0.80
EqualMethod · 0.80
listRunFunction · 0.70
RunMethod · 0.65

Tested by

no test coverage detected