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

Function TestFailingHook

hooks/commit_msg_test.go:44–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestFailingHook(t *testing.T) {
45 tempDir := initGitForCommitMsg(t)
46 tempDir.MkdirAll(".quickhook", "commit-msg")
47 tempDir.WriteFile(
48 []string{".quickhook", "commit-msg", "fails"},
49 "#!/bin/bash \n echo \"failed\" \n exit 1")
50
51 output, err := tempDir.ExecQuickhook("hook", "commit-msg", writeCommitEditMsg(t, "Test"))
52 assert.Error(t, err)
53 assert.Equal(t, "fails: failed\n", output)
54}

Callers

nothing calls this directly

Calls 5

initGitForCommitMsgFunction · 0.85
writeCommitEditMsgFunction · 0.85
MkdirAllMethod · 0.80
WriteFileMethod · 0.80
ExecQuickhookMethod · 0.80

Tested by

no test coverage detected