MCPcopy Create free account
hub / github.com/cli/cli / TestPRView_web_currentBranch

Function TestPRView_web_currentBranch

pkg/cmd/pr/view/view_test.go:639–656  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

637}
638
639func TestPRView_web_currentBranch(t *testing.T) {
640 http := &httpmock.Registry{}
641 defer http.Verify(t)
642
643 shared.StubFinderForRunCommandStyleTests(t, "", &api.PullRequest{URL: "https://github.com/OWNER/REPO/pull/10"}, ghrepo.New("OWNER", "REPO"))
644
645 _, cmdTeardown := run.Stub()
646 defer cmdTeardown(t)
647
648 output, err := runCommand(http, "blueberries", true, "-w")
649 if err != nil {
650 t.Errorf("error running command `pr view`: %v", err)
651 }
652
653 assert.Equal(t, "", output.String())
654 assert.Equal(t, "Opening https://github.com/OWNER/REPO/pull/10 in your browser.\n", output.Stderr())
655 assert.Equal(t, "https://github.com/OWNER/REPO/pull/10", output.BrowsedURL)
656}
657
658func TestPRView_web_noResultsForBranch(t *testing.T) {
659 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 9

VerifyMethod · 0.95
NewFunction · 0.92
StubFunction · 0.92
EqualMethod · 0.80
StderrMethod · 0.80
runCommandFunction · 0.70
ErrorfMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected