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

Function TestFailingHookWithoutPty

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

Source from the content-addressed store, hash-verified

25}
26
27func TestFailingHookWithoutPty(t *testing.T) {
28 tempDir := initGitForPreCommit(t)
29 tempDir.MkdirAll(".quickhook", "pre-commit")
30 tempDir.WriteFile(
31 []string{".quickhook", "pre-commit", "fails"},
32 "#!/bin/bash \n printf \"first line\\nsecond line\\n\" \n exit 1")
33
34 output, err := tempDir.ExecQuickhook("hook", "pre-commit")
35 assert.Error(t, err)
36 assert.Equal(t, "fails: first line\nfails: second line\n", output)
37}
38
39func TestFailingHookWithPty(t *testing.T) {
40 ptyTests := []struct {

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