MCPcopy Index your code
hub / github.com/cli/cli / TestPRRevert_missingArgument

Function TestPRRevert_missingArgument

pkg/cmd/pr/revert/revert_test.go:52–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func 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
69func TestPRRevert_acceptedIdentifierFormats(t *testing.T) {
70 tests := []struct {

Callers

nothing calls this directly

Calls 4

VerifyMethod · 0.95
NewFunction · 0.92
runCommandFunction · 0.70

Tested by

no test coverage detected