(t *testing.T)
| 267 | } |
| 268 | |
| 269 | func TestPRStatus_currentBranch_Closed(t *testing.T) { |
| 270 | http := initFakeHTTP() |
| 271 | defer http.Verify(t) |
| 272 | http.Register(httpmock.GraphQL(`query PullRequestStatus\b`), httpmock.FileResponse("./fixtures/prStatusCurrentBranchClosed.json")) |
| 273 | |
| 274 | // stub successful git command |
| 275 | rs, cleanup := run.Stub() |
| 276 | defer cleanup(t) |
| 277 | rs.Register(`git config --get-regexp \^branch\\.`, 0, "") |
| 278 | rs.Register(`git config remote.pushDefault`, 0, "") |
| 279 | rs.Register(`git rev-parse --symbolic-full-name blueberries@{push}`, 128, "") |
| 280 | rs.Register(`git config push.default`, 1, "") |
| 281 | |
| 282 | output, err := runCommand(http, "blueberries", true, "") |
| 283 | if err != nil { |
| 284 | t.Errorf("error running command `pr status`: %v", err) |
| 285 | } |
| 286 | |
| 287 | expectedLine := regexp.MustCompile(`#8 Blueberries are a good fruit \[blueberries\] - Closed`) |
| 288 | if !expectedLine.MatchString(output.String()) { |
| 289 | t.Errorf("output did not match regexp /%s/\n> output\n%s\n", expectedLine, output) |
| 290 | return |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | func TestPRStatus_currentBranch_Closed_defaultBranch(t *testing.T) { |
| 295 | http := initFakeHTTP() |
nothing calls this directly
no test coverage detected