MCPcopy Create free account
hub / github.com/dirk/quickhook / TestInstallPreCommitMutatingYes

Function TestInstallPreCommitMutatingYes

install_test.go:30–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func 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
45func TestInstallNoQuickhookDirectory(t *testing.T) {
46 tempDir := test.NewTempDir(t, 0)

Callers

nothing calls this directly

Calls 4

RequireExecMethod · 0.95
MkdirAllMethod · 0.95
ExecQuickhookMethod · 0.95
NewTempDirFunction · 0.92

Tested by

no test coverage detected