Update issue_test.go
Add test for closing issue Co-Authored-By: Nate Smith <vilmibm@neongrid.space>
This commit is contained in:
parent
2d0d86f7e7
commit
e5fc3e9bbd
1 changed files with 22 additions and 0 deletions
|
|
@ -680,3 +680,25 @@ func TestIssueStateTitleWithColor(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssueClose(t *testing.T) {
|
||||
initBlankContext("", "OWNER/REPO", "master")
|
||||
http := initFakeHTTP()
|
||||
http.StubRepoResponse("OWNER", "REPO")
|
||||
|
||||
jsonFile, _ := os.Open("../test/fixtures/issueClose.json")
|
||||
defer jsonFile.Close()
|
||||
http.StubResponse(200, jsonFile)
|
||||
|
||||
output, err := RunCommand(issueStatusCmd, "issue close 13")
|
||||
if err != nil {
|
||||
t.Errorf("error running command `issue close`: %v", err)
|
||||
}
|
||||
|
||||
r := regexp.MustCompile(`WHATEVER!`)
|
||||
|
||||
if !r.MatchString(output.String()) {
|
||||
t.Errorf("output did not match regexp /%s/\n> output\n%s\n", r, output)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue