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

Function TestInstallPreCommitYes

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

Source from the content-addressed store, hash-verified

13)
14
15func 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
30func TestInstallPreCommitMutatingYes(t *testing.T) {
31 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