(t *testing.T)
| 367 | } |
| 368 | |
| 369 | func TestPRStatus_blankSlate(t *testing.T) { |
| 370 | http := initFakeHTTP() |
| 371 | defer http.Verify(t) |
| 372 | http.Register(httpmock.GraphQL(`query PullRequestStatus\b`), httpmock.StringResponse(`{"data": {}}`)) |
| 373 | |
| 374 | // stub successful git command |
| 375 | rs, cleanup := run.Stub() |
| 376 | defer cleanup(t) |
| 377 | rs.Register(`git config --get-regexp \^branch\\.`, 0, "") |
| 378 | rs.Register(`git config remote.pushDefault`, 0, "") |
| 379 | rs.Register(`git rev-parse --symbolic-full-name blueberries@{push}`, 128, "") |
| 380 | rs.Register(`git config push.default`, 1, "") |
| 381 | |
| 382 | output, err := runCommand(http, "blueberries", true, "") |
| 383 | if err != nil { |
| 384 | t.Errorf("error running command `pr status`: %v", err) |
| 385 | } |
| 386 | |
| 387 | expected := ` |
| 388 | Relevant pull requests in OWNER/REPO |
| 389 | |
| 390 | Current branch |
| 391 | There is no pull request associated with [blueberries] |
| 392 | |
| 393 | Created by you |
| 394 | You have no open pull requests |
| 395 | |
| 396 | Requesting a code review from you |
| 397 | You have no pull requests to review |
| 398 | |
| 399 | ` |
| 400 | if output.String() != expected { |
| 401 | t.Errorf("expected %q, got %q", expected, output.String()) |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | func TestPRStatus_blankSlateRepoOverride(t *testing.T) { |
| 406 | http := initFakeHTTP() |
nothing calls this directly
no test coverage detected