MCPcopy
hub / github.com/cli/cli / Test_ViewRun

Function Test_ViewRun

pkg/cmd/repo/view/view_test.go:232–369  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

230}
231
232func Test_ViewRun(t *testing.T) {
233 tests := []struct {
234 name string
235 opts *ViewOptions
236 repoName string
237 stdoutTTY bool
238 wantOut string
239 wantStderr string
240 wantErr bool
241 }{
242 {
243 name: "nontty",
244 wantOut: heredoc.Doc(`
245 name: OWNER/REPO
246 description: social distancing
247 --
248 # truly cool readme check it out
249 `),
250 },
251 {
252 name: "url arg",
253 repoName: "jill/valentine",
254 opts: &ViewOptions{
255 RepoArg: "https://github.com/jill/valentine",
256 },
257 stdoutTTY: true,
258 wantOut: heredoc.Doc(`
259 jill/valentine
260 social distancing
261
262
263 # truly cool readme check it out
264
265
266
267 View this repository on GitHub: https://github.com/jill/valentine
268 `),
269 },
270 {
271 name: "name arg",
272 repoName: "jill/valentine",
273 opts: &ViewOptions{
274 RepoArg: "jill/valentine",
275 },
276 stdoutTTY: true,
277 wantOut: heredoc.Doc(`
278 jill/valentine
279 social distancing
280
281
282 # truly cool readme check it out
283
284
285
286 View this repository on GitHub: https://github.com/jill/valentine
287 `),
288 },
289 {

Callers

nothing calls this directly

Calls 13

RegisterMethod · 0.95
VerifyMethod · 0.95
FromFullNameFunction · 0.92
GraphQLFunction · 0.92
StringResponseFunction · 0.92
RESTFunction · 0.92
TestFunction · 0.92
SetStdoutTTYMethod · 0.80
EqualMethod · 0.80
viewRunFunction · 0.70
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected