(t *testing.T)
| 25 | } |
| 26 | |
| 27 | func 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 | |
| 39 | func TestFailingHookWithPty(t *testing.T) { |
| 40 | ptyTests := []struct { |
nothing calls this directly
no test coverage detected