(t *testing.T)
| 1532 | } |
| 1533 | |
| 1534 | func 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 | |
| 1553 | func TestPublishRun_DirArgUsesTargetRemote(t *testing.T) { |
| 1554 | cs, cmdTeardown := run.Stub() |
nothing calls this directly
no test coverage detected