(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestPRRevert_missingArgument(t *testing.T) { |
| 53 | http := &httpmock.Registry{} |
| 54 | defer http.Verify(t) |
| 55 | |
| 56 | shared.StubFinderForRunCommandStyleTests(t, "123", &api.PullRequest{ |
| 57 | ID: "SOME-ID", |
| 58 | Number: 123, |
| 59 | State: "MERGED", |
| 60 | Title: "The title of the PR", |
| 61 | }, ghrepo.New("OWNER", "REPO")) |
| 62 | |
| 63 | // No arguments provided. |
| 64 | _, err := runCommand(http, true, "") |
| 65 | // Exits non-zero and prints an argument error. |
| 66 | assert.EqualError(t, err, "cannot revert pull request: number, url, or branch required") |
| 67 | } |
| 68 | |
| 69 | func TestPRRevert_acceptedIdentifierFormats(t *testing.T) { |
| 70 | tests := []struct { |
nothing calls this directly
no test coverage detected