Skip to content

Instantly share code, notes, and snippets.

@oafridi
Last active November 6, 2015 17:15
Show Gist options
  • Save oafridi/d31cf5c85d3f8191cf21 to your computer and use it in GitHub Desktop.
Save oafridi/d31cf5c85d3f8191cf21 to your computer and use it in GitHub Desktop.
pre commit hook for rspec focus
#!/bin/sh
exec 1>&2
if [ $? -eq 0 ]
then
echo "Error: attempted to check in an rspec *_spec.rb file which contains a focus."
echo "Do \"find . -name '*_spec.rb' | xargs egrep '^\s*(describe|it|context)\b.*focus'\" to find out."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment