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

Function TestPRReopen_alreadyMerged

pkg/cmd/pr/reopen/reopen_test.go:94–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

92}
93
94func TestPRReopen_alreadyMerged(t *testing.T) {
95 http := &httpmock.Registry{}
96 defer http.Verify(t)
97
98 shared.StubFinderForRunCommandStyleTests(t, "123", &api.PullRequest{
99 ID: "THE-ID",
100 Number: 123,
101 State: "MERGED",
102 Title: "The title of the PR",
103 }, ghrepo.New("OWNER", "REPO"))
104
105 output, err := runCommand(http, true, "123")
106 assert.EqualError(t, err, "SilentError")
107 assert.Equal(t, "", output.String())
108 assert.Equal(t, "X Pull request OWNER/REPO#123 (The title of the PR) can't be reopened because it was already merged\n", output.Stderr())
109}
110
111func TestPRReopen_withComment(t *testing.T) {
112 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 7

VerifyMethod · 0.95
NewFunction · 0.92
EqualMethod · 0.80
StderrMethod · 0.80
runCommandFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected