File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,28 @@ func Test_NewCmdLogin(t *testing.T) {
118118 cli : "--web --with-token" ,
119119 wantsErr : true ,
120120 },
121+ {
122+ name : "tty one scope" ,
123+ stdinTTY : true ,
124+ cli : "--scopes repo:invite" ,
125+ wants : LoginOptions {
126+ Hostname : "" ,
127+ Scopes : []string {"repo:invite" },
128+ Token : "" ,
129+ Interactive : true ,
130+ },
131+ },
132+ {
133+ name : "tty scopes" ,
134+ stdinTTY : true ,
135+ cli : "--scopes repo:invite,read:public_key" ,
136+ wants : LoginOptions {
137+ Hostname : "" ,
138+ Scopes : []string {"repo:invite" , "read:public_key" },
139+ Token : "" ,
140+ Interactive : true ,
141+ },
142+ },
121143 }
122144
123145 for _ , tt := range tests {
@@ -160,6 +182,7 @@ func Test_NewCmdLogin(t *testing.T) {
160182 assert .Equal (t , tt .wants .Hostname , gotOpts .Hostname )
161183 assert .Equal (t , tt .wants .Web , gotOpts .Web )
162184 assert .Equal (t , tt .wants .Interactive , gotOpts .Interactive )
185+ assert .Equal (t , tt .wants .Scopes , gotOpts .Scopes )
163186 })
164187 }
165188}
You can’t perform that action at this time.
0 commit comments