Skip to content

Instantly share code, notes, and snippets.

@texel
Created April 26, 2013 23:53
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 texel/5471203 to your computer and use it in GitHub Desktop.
Save texel/5471203 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
diff_body = `git diff --staged`
# Detect whether we're adding a :focus => true line in a spec file
focus_regex = /^\+.*(describe|context|it).*:focus/
if diff_body =~ focus_regex
puts "\nAttempting to commit a spec with :focus => true. Aborting...\n\n"
puts diff_body
exit 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment