(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func TestIssueReopen_alreadyOpen(t *testing.T) { |
| 98 | http := &httpmock.Registry{} |
| 99 | defer http.Verify(t) |
| 100 | |
| 101 | http.Register( |
| 102 | httpmock.GraphQL(`query IssueByNumber\b`), |
| 103 | httpmock.StringResponse(` |
| 104 | { "data": { "repository": { |
| 105 | "hasIssuesEnabled": true, |
| 106 | "issue": { "number": 2, "state": "OPEN", "title": "The title of the issue"} |
| 107 | } } }`), |
| 108 | ) |
| 109 | |
| 110 | output, err := runCommand(http, true, "2") |
| 111 | if err != nil { |
| 112 | t.Fatalf("error running command `issue reopen`: %v", err) |
| 113 | } |
| 114 | |
| 115 | r := regexp.MustCompile(`Issue OWNER/REPO#2 \(The title of the issue\) is already open`) |
| 116 | |
| 117 | if !r.MatchString(output.Stderr()) { |
| 118 | t.Fatalf("output did not match regexp /%s/\n> output\n%q\n", r, output.Stderr()) |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | func TestIssueReopen_issuesDisabled(t *testing.T) { |
| 123 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected