(t *testing.T)
| 225 | } |
| 226 | |
| 227 | func TestPRStatus_currentBranch_defaultBranch(t *testing.T) { |
| 228 | http := initFakeHTTP() |
| 229 | defer http.Verify(t) |
| 230 | http.Register(httpmock.GraphQL(`query PullRequestStatus\b`), httpmock.FileResponse("./fixtures/prStatusCurrentBranch.json")) |
| 231 | |
| 232 | // stub successful git command |
| 233 | rs, cleanup := run.Stub() |
| 234 | defer cleanup(t) |
| 235 | rs.Register(`git config --get-regexp \^branch\\.`, 0, "") |
| 236 | rs.Register(`git config remote.pushDefault`, 0, "") |
| 237 | rs.Register(`git rev-parse --symbolic-full-name blueberries@{push}`, 128, "") |
| 238 | rs.Register(`git config push.default`, 1, "") |
| 239 | |
| 240 | output, err := runCommand(http, "blueberries", true, "") |
| 241 | if err != nil { |
| 242 | t.Errorf("error running command `pr status`: %v", err) |
| 243 | } |
| 244 | |
| 245 | expectedLine := regexp.MustCompile(`#10 Blueberries are certainly a good fruit \[blueberries\]`) |
| 246 | if !expectedLine.MatchString(output.String()) { |
| 247 | t.Errorf("output did not match regexp /%s/\n> output\n%s\n", expectedLine, output) |
| 248 | return |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | func TestPRStatus_currentBranch_defaultBranch_repoFlag(t *testing.T) { |
| 253 | http := initFakeHTTP() |
nothing calls this directly
no test coverage detected