MCPcopy
hub / github.com/cli/cli / TestDetectGitHubRemote_UsesDir

Function TestDetectGitHubRemote_UsesDir

pkg/cmd/skills/publish/publish_test.go:1534–1551  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1532}
1533
1534func TestDetectGitHubRemote_UsesDir(t *testing.T) {
1535 cs, cmdTeardown := run.Stub()
1536 defer cmdTeardown(t)
1537 stubGitRemote(cs, map[string]string{
1538 "origin": "https://github.com/monalisa/target-repo.git",
1539 })
1540
1541 cwdRepo := t.TempDir()
1542 targetRepo := t.TempDir()
1543
1544 gitClient := &git.Client{GitPath: "some/path/git", RepoDir: cwdRepo}
1545
1546 repo, err := detectGitHubRemote(gitClient, targetRepo)
1547 require.NoError(t, err)
1548 require.NotNil(t, repo)
1549 assert.Equal(t, "monalisa", repo.Repo.RepoOwner())
1550 assert.Equal(t, "target-repo", repo.Repo.RepoName())
1551}
1552
1553func TestPublishRun_DirArgUsesTargetRemote(t *testing.T) {
1554 cs, cmdTeardown := run.Stub()

Callers

nothing calls this directly

Calls 6

StubFunction · 0.92
stubGitRemoteFunction · 0.85
detectGitHubRemoteFunction · 0.85
EqualMethod · 0.80
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65

Tested by

no test coverage detected