MCPcopy
hub / github.com/cli/cli / Test_NewCmdList

Function Test_NewCmdList

pkg/cmd/ruleset/list/list_test.go:21–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func Test_NewCmdList(t *testing.T) {
22 tests := []struct {
23 name string
24 args string
25 isTTY bool
26 want ListOptions
27 wantErr string
28 }{
29 {
30 name: "no arguments",
31 args: "",
32 isTTY: true,
33 want: ListOptions{
34 Limit: 30,
35 IncludeParents: true,
36 WebMode: false,
37 Organization: "",
38 },
39 },
40 {
41 name: "limit",
42 args: "--limit 1",
43 isTTY: true,
44 want: ListOptions{
45 Limit: 1,
46 IncludeParents: true,
47 WebMode: false,
48 Organization: "",
49 },
50 },
51 {
52 name: "include parents",
53 args: "--parents=false",
54 isTTY: true,
55 want: ListOptions{
56 Limit: 30,
57 IncludeParents: false,
58 WebMode: false,
59 Organization: "",
60 },
61 },
62 {
63 name: "org",
64 args: "--org \"my-org\"",
65 isTTY: true,
66 want: ListOptions{
67 Limit: 30,
68 IncludeParents: true,
69 WebMode: false,
70 Organization: "my-org",
71 },
72 },
73 {
74 name: "web mode",
75 args: "--web",
76 isTTY: true,
77 want: ListOptions{
78 Limit: 30,

Callers

nothing calls this directly

Calls 7

TestFunction · 0.92
SetStdoutTTYMethod · 0.80
SetStdinTTYMethod · 0.80
SetStderrTTYMethod · 0.80
EqualMethod · 0.80
NewCmdListFunction · 0.70
RunMethod · 0.65

Tested by

no test coverage detected