Be sure that your commit pass tests
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:
#!/bin/sh
rake spec
and save it as .git/hooks/pre-commit
. Then before every commit git will run all your RSpec test. Pretty awesome, huh?
PS
If you wanna to omit tests before commit just run
$ git commit --no-verify
or
$ git commit -n
Written by Łukasz Niemier
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#