Skip to content

Instantly share code, notes, and snippets.

@twmills
Created February 23, 2011 03:04
Show Gist options
  • Select an option

  • Save twmills/839927 to your computer and use it in GitHub Desktop.

Select an option

Save twmills/839927 to your computer and use it in GitHub Desktop.
git pre-commit example
#!/bin/bash
source ".rvmrc"
ruby .git/hooks/run_tests.rb
run_tests.rb
-----------
puts "Running tests..."
`bundle exec rspec spec/* > /dev/null 2>&1 && cucumber -r features > /dev/null 2>&1`
if $? != 0
puts "Tests failed"
exit(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment