Preventing your developers (and yourself) from breaking the build is as simple as putting this in your .git/hooks/pre-commit and making it executable (chmod +x .git/hooks/pre-commit).
#!/bin/sh
rake spec 2> /dev/null
This will stop the commit if the specs don’t pass.