(t *testing.T)
| 75 | } |
| 76 | |
| 77 | func TestWithRepoDirReplacesExistingRepository(t *testing.T) { |
| 78 | // Given a Git command already scoped to a repository |
| 79 | command := &Command{exec.Command("git", "-C", "old/repo", "status")} |
| 80 | |
| 81 | // When its repository directory is changed |
| 82 | WithRepoDir("new/repo")(command) |
| 83 | |
| 84 | // Then the existing repository value is replaced without adding another option |
| 85 | assert.Equal(t, []string{"git", "-C", "new/repo", "status"}, command.Args) |
| 86 | } |
nothing calls this directly
no test coverage detected