(t *testing.T)
| 514 | } |
| 515 | |
| 516 | func TestPRCheckout_sameRepo(t *testing.T) { |
| 517 | http := &httpmock.Registry{} |
| 518 | defer http.Verify(t) |
| 519 | |
| 520 | baseRepo, pr := stubPR("OWNER/REPO", "OWNER/REPO:feature") |
| 521 | finder := shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 522 | finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository", "maintainerCanModify"}) |
| 523 | |
| 524 | cs, cmdTeardown := run.Stub() |
| 525 | defer cmdTeardown(t) |
| 526 | |
| 527 | cs.Register(`git fetch origin \+refs/heads/feature:refs/remotes/origin/feature --no-tags`, 0, "") |
| 528 | cs.Register(`git show-ref --verify -- refs/heads/feature`, 1, "") |
| 529 | cs.Register(`git checkout -b feature --track origin/feature`, 0, "") |
| 530 | |
| 531 | output, err := runCommand(http, nil, "master", `123`, baseRepo) |
| 532 | assert.NoError(t, err) |
| 533 | assert.Equal(t, "", output.String()) |
| 534 | assert.Equal(t, "", output.Stderr()) |
| 535 | } |
| 536 | |
| 537 | func TestPRCheckout_existingBranch(t *testing.T) { |
| 538 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected