(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestInstallPreCommitYes(t *testing.T) { |
| 16 | tempDir := test.NewTempDir(t, 0) |
| 17 | tempDir.RequireExec("git", "init", "--quiet", ".") |
| 18 | tempDir.MkdirAll(".quickhook", "pre-commit") |
| 19 | |
| 20 | output, err := tempDir.ExecQuickhook("install", "--yes") |
| 21 | assert.NoError(t, err) |
| 22 | shimPath := path.Join(".git", "hooks", "pre-commit") |
| 23 | assert.Equal(t, |
| 24 | fmt.Sprintf("Installed shim %v", shimPath), |
| 25 | strings.TrimSpace(output)) |
| 26 | assert.FileExists(t, |
| 27 | path.Join(tempDir.Root, shimPath)) |
| 28 | } |
| 29 | |
| 30 | func TestInstallPreCommitMutatingYes(t *testing.T) { |
| 31 | tempDir := test.NewTempDir(t, 0) |
nothing calls this directly
no test coverage detected