(t *testing.T)
| 1027 | } |
| 1028 | |
| 1029 | func TestPRCheckout_differentRepo_existingBranch(t *testing.T) { |
| 1030 | http := &httpmock.Registry{} |
| 1031 | defer http.Verify(t) |
| 1032 | |
| 1033 | baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature") |
| 1034 | shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 1035 | |
| 1036 | cs, cmdTeardown := run.Stub() |
| 1037 | defer cmdTeardown(t) |
| 1038 | cs.Register(`git fetch origin refs/pull/123/head:feature --no-tags`, 0, "") |
| 1039 | cs.Register(`git config branch\.feature\.merge`, 0, "refs/heads/feature\n") |
| 1040 | cs.Register(`git checkout feature`, 0, "") |
| 1041 | |
| 1042 | output, err := runCommand(http, nil, "master", `123`, baseRepo) |
| 1043 | assert.NoError(t, err) |
| 1044 | assert.Equal(t, "", output.String()) |
| 1045 | assert.Equal(t, "", output.Stderr()) |
| 1046 | } |
| 1047 | |
| 1048 | func TestPRCheckout_detachedHead(t *testing.T) { |
| 1049 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected