Last active
December 18, 2015 01:09
-
-
Save j-mcnally/5701575 to your computer and use it in GitHub Desktop.
Git pre-commit hook for rspec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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