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

Function TestPassesWithPassingHooks

hooks/pre_commit_test.go:90–103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestPassesWithPassingHooks(t *testing.T) {
91 tempDir := initGitForPreCommit(t)
92 tempDir.MkdirAll(".quickhook", "pre-commit")
93 tempDir.WriteFile(
94 []string{".quickhook", "pre-commit", "passes1"},
95 "#!/bin/bash \n echo \"passed\" \n exit 0")
96 tempDir.WriteFile(
97 []string{".quickhook", "pre-commit", "passes2"},
98 "#!/bin/sh \n echo \"passed\"")
99
100 output, err := tempDir.ExecQuickhook("hook", "pre-commit")
101 assert.NoError(t, err)
102 assert.Equal(t, "", output)
103}
104
105func TestPassesWithNoFilesToBeCommitted(t *testing.T) {
106 tempDir := initGitForPreCommit(t)

Callers

nothing calls this directly

Calls 4

initGitForPreCommitFunction · 0.85
MkdirAllMethod · 0.80
WriteFileMethod · 0.80
ExecQuickhookMethod · 0.80

Tested by

no test coverage detected