Skip to content

Instantly share code, notes, and snippets.

@j-mcnally
Last active December 18, 2015 01:09
Show Gist options
  • Select an option

  • Save j-mcnally/5701575 to your computer and use it in GitHub Desktop.

Select an option

Save j-mcnally/5701575 to your computer and use it in GitHub Desktop.
Git pre-commit hook for rspec
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit". The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if rvm 1.9.3 do rspec
then
echo "Tests passed"
else
echo "Fix your tests and retry your commit"
echo "If you really have to commit this broken code use \"git commit --no-verify\" "
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment