(t *testing.T)
| 651 | } |
| 652 | |
| 653 | func TestPRCheckout_detachedHead(t *testing.T) { |
| 654 | http := &httpmock.Registry{} |
| 655 | defer http.Verify(t) |
| 656 | |
| 657 | baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature") |
| 658 | shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 659 | |
| 660 | cs, cmdTeardown := run.Stub() |
| 661 | defer cmdTeardown(t) |
| 662 | cs.Register(`git fetch origin refs/pull/123/head:feature --no-tags`, 0, "") |
| 663 | cs.Register(`git config branch\.feature\.merge`, 0, "refs/heads/feature\n") |
| 664 | cs.Register(`git checkout feature`, 0, "") |
| 665 | |
| 666 | output, err := runCommand(http, nil, "", `123`, baseRepo) |
| 667 | assert.NoError(t, err) |
| 668 | assert.Equal(t, "", output.String()) |
| 669 | assert.Equal(t, "", output.Stderr()) |
| 670 | } |
| 671 | |
| 672 | func TestPRCheckout_differentRepo_currentBranch(t *testing.T) { |
| 673 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected