Skip to content

Instantly share code, notes, and snippets.

@threewordphrase
Created September 18, 2015 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save threewordphrase/d859a4430c93c0dc2bd3 to your computer and use it in GitHub Desktop.
Save threewordphrase/d859a4430c93c0dc2bd3 to your computer and use it in GitHub Desktop.
RSpec pre-push git hook
echo "Running RSpec"
bundle exec rake spec
spec=$?
if [ $spec -eq 0 ]; then
osascript -e 'display notification "Tests have passed, pushing" with title "EMT Specs"'
echo "\\033[32mTests are green, pushing...\\033[0;39m"
exit 0
else
osascript -e 'display notification "Tests have failed, stopping push" with title "EMT Specs"'
echo "\\033[1;31mCannot push, tests are failing. Use --no-verify to force push.\\033[0;39m"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment