(t *testing.T)
| 342 | } |
| 343 | |
| 344 | func TestPRStatus_currentBranch_Merged_defaultBranch(t *testing.T) { |
| 345 | http := initFakeHTTP() |
| 346 | defer http.Verify(t) |
| 347 | http.Register(httpmock.GraphQL(`query PullRequestStatus\b`), httpmock.FileResponse("./fixtures/prStatusCurrentBranchMergedOnDefaultBranch.json")) |
| 348 | |
| 349 | // stub successful git command |
| 350 | rs, cleanup := run.Stub() |
| 351 | defer cleanup(t) |
| 352 | rs.Register(`git config --get-regexp \^branch\\.`, 0, "") |
| 353 | rs.Register(`git config remote.pushDefault`, 0, "") |
| 354 | rs.Register(`git rev-parse --symbolic-full-name blueberries@{push}`, 128, "") |
| 355 | rs.Register(`git config push.default`, 1, "") |
| 356 | |
| 357 | output, err := runCommand(http, "blueberries", true, "") |
| 358 | if err != nil { |
| 359 | t.Errorf("error running command `pr status`: %v", err) |
| 360 | } |
| 361 | |
| 362 | expectedLine := regexp.MustCompile(`There is no pull request associated with \[blueberries\]`) |
| 363 | if !expectedLine.MatchString(output.String()) { |
| 364 | t.Errorf("output did not match regexp /%s/\n> output\n%s\n", expectedLine, output) |
| 365 | return |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | func TestPRStatus_blankSlate(t *testing.T) { |
| 370 | http := initFakeHTTP() |
nothing calls this directly
no test coverage detected