(t *testing.T)
| 670 | } |
| 671 | |
| 672 | func TestPRCheckout_differentRepo_currentBranch(t *testing.T) { |
| 673 | http := &httpmock.Registry{} |
| 674 | defer http.Verify(t) |
| 675 | |
| 676 | baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature") |
| 677 | shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 678 | |
| 679 | cs, cmdTeardown := run.Stub() |
| 680 | defer cmdTeardown(t) |
| 681 | cs.Register(`git fetch origin refs/pull/123/head --no-tags`, 0, "") |
| 682 | cs.Register(`git config branch\.feature\.merge`, 0, "refs/heads/feature\n") |
| 683 | cs.Register(`git merge --ff-only FETCH_HEAD`, 0, "") |
| 684 | |
| 685 | output, err := runCommand(http, nil, "feature", `123`, baseRepo) |
| 686 | assert.NoError(t, err) |
| 687 | assert.Equal(t, "", output.String()) |
| 688 | assert.Equal(t, "", output.Stderr()) |
| 689 | } |
| 690 | |
| 691 | func TestPRCheckout_differentRepo_invalidBranchName(t *testing.T) { |
| 692 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected