File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -707,6 +707,32 @@ func TestIssueClose(t *testing.T) {
707707 }
708708}
709709
710+ func TestIssueClose_alreadyClosed (t * testing.T ) {
711+ initBlankContext ("" , "OWNER/REPO" , "master" )
712+ http := initFakeHTTP ()
713+ http .StubRepoResponse ("OWNER" , "REPO" )
714+
715+ http .StubResponse (200 , bytes .NewBufferString (`
716+ { "data": { "repository": {
717+ "hasIssuesEnabled": true,
718+ "issue": { "number": 13, "closed": true}
719+ } } }
720+ ` ))
721+
722+ http .StubResponse (200 , bytes .NewBufferString (`{"id": "THE-ID"}` ))
723+
724+ output , err := RunCommand (issueCloseCmd , "issue close 13" )
725+ if err != nil {
726+ t .Fatalf ("error running command `issue close`: %v" , err )
727+ }
728+
729+ r := regexp .MustCompile (`#13 is already closed` )
730+
731+ if ! r .MatchString (output .Stderr ()) {
732+ t .Fatalf ("output did not match regexp /%s/\n > output\n %q\n " , r , output .Stderr ())
733+ }
734+ }
735+
710736func TestIssueClose_issuesDisabled (t * testing.T ) {
711737 initBlankContext ("" , "OWNER/REPO" , "master" )
712738 http := initFakeHTTP ()
You can’t perform that action at this time.
0 commit comments