(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func TestInstallPreCommitMutatingYes(t *testing.T) { |
| 31 | tempDir := test.NewTempDir(t, 0) |
| 32 | tempDir.RequireExec("git", "init", "--quiet", ".") |
| 33 | tempDir.MkdirAll(".quickhook", "pre-commit-mutating") |
| 34 | |
| 35 | output, err := tempDir.ExecQuickhook("install", "--yes") |
| 36 | assert.NoError(t, err) |
| 37 | shimPath := path.Join(".git", "hooks", "pre-commit") |
| 38 | assert.Equal(t, |
| 39 | fmt.Sprintf("Installed shim %v", shimPath), |
| 40 | strings.TrimSpace(output)) |
| 41 | assert.FileExists(t, |
| 42 | path.Join(tempDir.Root, shimPath)) |
| 43 | } |
| 44 | |
| 45 | func TestInstallNoQuickhookDirectory(t *testing.T) { |
| 46 | tempDir := test.NewTempDir(t, 0) |
nothing calls this directly
no test coverage detected