Skip to content

Instantly share code, notes, and snippets.

@madsheep
Last active December 27, 2015 14:09
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 madsheep/7338090 to your computer and use it in GitHub Desktop.
Save madsheep/7338090 to your computer and use it in GitHub Desktop.
Ultimate solution for long running specs. It's not that rails are slow, or rspec is slow, or ruby is slow. It's your code that is slow and/or poorly designed. The solution to slow tests problem is not optimizing them once the are too slow - it's about not letting them get slugish in the first place.
# in your spec_helper.rb
RSpec.configure do |config|
config.around(:each) do |example|
timeout(0.2) { example.run }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment