diff options
Diffstat (limited to '_posts/2009-04-14-git-and-prove.md')
| -rw-r--r-- | _posts/2009-04-14-git-and-prove.md | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/_posts/2009-04-14-git-and-prove.md b/_posts/2009-04-14-git-and-prove.md deleted file mode 100644 index f76f21d..0000000 --- a/_posts/2009-04-14-git-and-prove.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -layout: post -summary: In which I add a hook to git to run my tests. -title: Git and prove -type: codex ---- - -A little trick to force you to run your tests before a commit: - -in a repositorie, create the following file **.git/hooks/pre-commit** with this content: - -{% highlight sh %} -#!/bin/sh -if [ -d t ]; then - res=`prove t` - if [ $? -gt 0 ]; then - echo "tests fails" - exit 1 - fi -fi -if [ -d xt ]; then - res=`prove xt` - if [ $? -gt 0 ]; then - echo "tests fails" - exit 1 - fi -fi -{% endhighlight %} - -and don't forget to chmod with +x. - -Now, when you will do your next commit, your test suit will be executed. If the tests fails, the commit will be rejected. |
