@@ -183,15 +183,16 @@ func TestPRList_filteringDraft(t *testing.T) {
183183 expectedQuery string
184184 }{
185185 {
186- "draft" ,
187- "--draft=1 " ,
188- `repo:OWNER/REPO is:pr is:open draft:true` ,
186+ name : "draft" ,
187+ cli : "--draft" ,
188+ expectedQuery : `repo:OWNER/REPO is:pr is:open draft:true` ,
189189 },
190190 {
191- "non-draft" ,
192- "--draft=false" ,
193- `repo:OWNER/REPO is:pr is:open draft:false` ,
194- }}
191+ name : "non-draft" ,
192+ cli : "--draft=false" ,
193+ expectedQuery : `repo:OWNER/REPO is:pr is:open draft:false` ,
194+ },
195+ }
195196
196197 for _ , test := range tests {
197198 t .Run (test .name , func (t * testing.T ) {
@@ -210,16 +211,13 @@ func TestPRList_filteringDraft(t *testing.T) {
210211 }
211212 })
212213 }
213-
214214}
215215
216216func TestPRList_withInvalidLimitFlag (t * testing.T ) {
217217 http := initFakeHTTP ()
218218 defer http .Verify (t )
219-
220219 _ , err := runCommand (http , true , `--limit=0` )
221- assert .NotNil (t , err )
222- assert .Equal (t , err .Error (), "invalid value for --limit: 0" )
220+ assert .EqualError (t , err , "invalid value for --limit: 0" )
223221}
224222
225223func TestPRList_web (t * testing.T ) {
@@ -229,19 +227,19 @@ func TestPRList_web(t *testing.T) {
229227 expectedBrowserURL string
230228 }{
231229 {
232- "test " ,
233- "-a peter -l bug -l docs -L 10 -s merged -B trunk" ,
234- "https://github.com/OWNER/REPO/pulls?q=is%3Apr+is%3Amerged+assignee%3Apeter+label%3Abug+label%3Adocs+base%3Atrunk" ,
230+ name : "filters " ,
231+ cli : "-a peter -l bug -l docs -L 10 -s merged -B trunk" ,
232+ expectedBrowserURL : "https://github.com/OWNER/REPO/pulls?q=is%3Apr+is%3Amerged+assignee%3Apeter+label%3Abug+label%3Adocs+base%3Atrunk" ,
235233 },
236234 {
237- "draft" ,
238- "--draft=true" ,
239- "https://github.com/OWNER/REPO/pulls?q=is%3Apr+is%3Aopen+draft%3Atrue" ,
235+ name : "draft" ,
236+ cli : "--draft=true" ,
237+ expectedBrowserURL : "https://github.com/OWNER/REPO/pulls?q=is%3Apr+is%3Aopen+draft%3Atrue" ,
240238 },
241239 {
242- "non-draft" ,
243- "--draft=0" ,
244- "https://github.com/OWNER/REPO/pulls?q=is%3Apr+is%3Aopen+draft%3Afalse" ,
240+ name : "non-draft" ,
241+ cli : "--draft=0" ,
242+ expectedBrowserURL : "https://github.com/OWNER/REPO/pulls?q=is%3Apr+is%3Aopen+draft%3Afalse" ,
245243 },
246244 }
247245
@@ -263,5 +261,4 @@ func TestPRList_web(t *testing.T) {
263261 assert .Equal (t , test .expectedBrowserURL , output .BrowsedURL )
264262 })
265263 }
266-
267264}
0 commit comments