MCPcopy
hub / github.com/cli/cli / TestPRView_web_currentBranch

Function TestPRView_web_currentBranch

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

Source from the content-addressed store, hash-verified

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

Tested by

no test coverage detected