Some times I've add some awesome code to my application and when I'm still euphoric I give it a commit and push it to repo. But some time after that I get mail from Travis CI that my new awesome code break some app and do not pass all tests. So I've got my mind and write this:
and save it as
.git/hooks/pre-commit. Then before every commit git will run all your RSpec test. Pretty awesome, huh?
If you wanna to omit tests before commit just run
$ git commit --no-verify
$ git commit -n