(t *testing.T)
| 907 | } |
| 908 | |
| 909 | func TestPRCheckout_sameRepo(t *testing.T) { |
| 910 | http := &httpmock.Registry{} |
| 911 | defer http.Verify(t) |
| 912 | |
| 913 | baseRepo, pr := stubPR("OWNER/REPO", "OWNER/REPO:feature") |
| 914 | finder := shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 915 | finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository", "maintainerCanModify"}) |
| 916 | |
| 917 | cs, cmdTeardown := run.Stub() |
| 918 | defer cmdTeardown(t) |
| 919 | |
| 920 | cs.Register(`git fetch origin \+refs/heads/feature:refs/remotes/origin/feature --no-tags`, 0, "") |
| 921 | cs.Register(`git rev-parse --verify refs/heads/feature`, 1, "") |
| 922 | cs.Register(`git checkout -b feature --track origin/feature`, 0, "") |
| 923 | |
| 924 | output, err := runCommand(http, nil, "master", `123`, baseRepo) |
| 925 | assert.NoError(t, err) |
| 926 | assert.Equal(t, "", output.String()) |
| 927 | assert.Equal(t, "", output.Stderr()) |
| 928 | } |
| 929 | |
| 930 | func TestPRCheckout_existingBranch(t *testing.T) { |
| 931 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected