(t *testing.T)
| 88 | } |
| 89 | |
| 90 | func 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 | |
| 105 | func TestPassesWithNoFilesToBeCommitted(t *testing.T) { |
| 106 | tempDir := initGitForPreCommit(t) |
nothing calls this directly
no test coverage detected