@@ -216,7 +216,7 @@ func TestIssueList_disabledIssues(t *testing.T) {
216216 }
217217}
218218
219- func TestIssueView (t * testing.T ) {
219+ func TestIssueView_web (t * testing.T ) {
220220 initBlankContext ("OWNER/REPO" , "master" )
221221 http := initFakeHTTP ()
222222 http .StubRepoResponse ("OWNER" , "REPO" )
@@ -235,7 +235,7 @@ func TestIssueView(t *testing.T) {
235235 })
236236 defer restoreCmd ()
237237
238- output , err := RunCommand (issueViewCmd , "issue view 123" )
238+ output , err := RunCommand (issueViewCmd , "issue view -w 123" )
239239 if err != nil {
240240 t .Errorf ("error running command `issue view`: %v" , err )
241241 }
@@ -250,7 +250,7 @@ func TestIssueView(t *testing.T) {
250250 eq (t , url , "https://github.com/OWNER/REPO/issues/123" )
251251}
252252
253- func TestIssueView_numberArgWithHash (t * testing.T ) {
253+ func TestIssueView_web_numberArgWithHash (t * testing.T ) {
254254 initBlankContext ("OWNER/REPO" , "master" )
255255 http := initFakeHTTP ()
256256 http .StubRepoResponse ("OWNER" , "REPO" )
@@ -269,7 +269,7 @@ func TestIssueView_numberArgWithHash(t *testing.T) {
269269 })
270270 defer restoreCmd ()
271271
272- output , err := RunCommand (issueViewCmd , "issue view \" #123\" " )
272+ output , err := RunCommand (issueViewCmd , "issue view -w \" #123\" " )
273273 if err != nil {
274274 t .Errorf ("error running command `issue view`: %v" , err )
275275 }
@@ -284,7 +284,7 @@ func TestIssueView_numberArgWithHash(t *testing.T) {
284284 eq (t , url , "https://github.com/OWNER/REPO/issues/123" )
285285}
286286
287- func TestIssueView_preview (t * testing.T ) {
287+ func TestIssueView (t * testing.T ) {
288288 initBlankContext ("OWNER/REPO" , "master" )
289289 http := initFakeHTTP ()
290290 http .StubRepoResponse ("OWNER" , "REPO" )
@@ -309,28 +309,21 @@ func TestIssueView_preview(t *testing.T) {
309309 } } } }
310310 ` ))
311311
312- output , err := RunCommand (issueViewCmd , "issue view -p 123" )
312+ output , err := RunCommand (issueViewCmd , "issue view 123" )
313313 if err != nil {
314314 t .Errorf ("error running command `issue view`: %v" , err )
315315 }
316316
317317 eq (t , output .Stderr (), "" )
318318
319- expectedLines := []* regexp.Regexp {
320- regexp .MustCompile (`ix of coins` ),
321- regexp .MustCompile (`opened by marseilles. 9 comments. \(tarot\)` ),
322- regexp .MustCompile (`bold story` ),
323- regexp .MustCompile (`View this issue on GitHub: https://github.com/OWNER/REPO/issues/123` ),
324- }
325- for _ , r := range expectedLines {
326- if ! r .MatchString (output .String ()) {
327- t .Errorf ("output did not match regexp /%s/\n > output\n %s\n " , r , output )
328- return
329- }
330- }
319+ test .ExpectLines (t , output .String (),
320+ "ix of coins" ,
321+ `opened by marseilles. 9 comments. \(tarot\)` ,
322+ "bold story" ,
323+ "View this issue on GitHub: https://github.com/OWNER/REPO/issues/123" )
331324}
332325
333- func TestIssueView_previewWithEmptyBody (t * testing.T ) {
326+ func TestIssueView_WithEmptyBody (t * testing.T ) {
334327 initBlankContext ("OWNER/REPO" , "master" )
335328 http := initFakeHTTP ()
336329 http .StubRepoResponse ("OWNER" , "REPO" )
@@ -355,27 +348,20 @@ func TestIssueView_previewWithEmptyBody(t *testing.T) {
355348 } } } }
356349 ` ))
357350
358- output , err := RunCommand (issueViewCmd , "issue view -p 123" )
351+ output , err := RunCommand (issueViewCmd , "issue view 123" )
359352 if err != nil {
360353 t .Errorf ("error running command `issue view`: %v" , err )
361354 }
362355
363356 eq (t , output .Stderr (), "" )
364357
365- expectedLines := []* regexp.Regexp {
366- regexp .MustCompile (`ix of coins` ),
367- regexp .MustCompile (`opened by marseilles. 9 comments. \(tarot\)` ),
368- regexp .MustCompile (`View this issue on GitHub: https://github.com/OWNER/REPO/issues/123` ),
369- }
370- for _ , r := range expectedLines {
371- if ! r .MatchString (output .String ()) {
372- t .Errorf ("output did not match regexp /%s/\n > output\n %s\n " , r , output )
373- return
374- }
375- }
358+ test .ExpectLines (t , output .String (),
359+ "ix of coins" ,
360+ `opened by marseilles. 9 comments. \(tarot\)` ,
361+ "View this issue on GitHub: https://github.com/OWNER/REPO/issues/123" )
376362}
377363
378- func TestIssueView_notFound (t * testing.T ) {
364+ func TestIssueView_web_notFound (t * testing.T ) {
379365 initBlankContext ("OWNER/REPO" , "master" )
380366 http := initFakeHTTP ()
381367
@@ -392,7 +378,7 @@ func TestIssueView_notFound(t *testing.T) {
392378 })
393379 defer restoreCmd ()
394380
395- _ , err := RunCommand (issueViewCmd , "issue view 9999" )
381+ _ , err := RunCommand (issueViewCmd , "issue view -w 9999" )
396382 if err == nil || err .Error () != "graphql error: 'Could not resolve to an Issue with the number of 9999.'" {
397383 t .Errorf ("error running command `issue view`: %v" , err )
398384 }
@@ -420,7 +406,7 @@ func TestIssueView_disabledIssues(t *testing.T) {
420406 }
421407}
422408
423- func TestIssueView_urlArg (t * testing.T ) {
409+ func TestIssueView_web_urlArg (t * testing.T ) {
424410 initBlankContext ("OWNER/REPO" , "master" )
425411 http := initFakeHTTP ()
426412 http .StubRepoResponse ("OWNER" , "REPO" )
@@ -439,7 +425,7 @@ func TestIssueView_urlArg(t *testing.T) {
439425 })
440426 defer restoreCmd ()
441427
442- output , err := RunCommand (issueViewCmd , "issue view https://github.com/OWNER/REPO/issues/123" )
428+ output , err := RunCommand (issueViewCmd , "issue view -w https://github.com/OWNER/REPO/issues/123" )
443429 if err != nil {
444430 t .Errorf ("error running command `issue view`: %v" , err )
445431 }
0 commit comments