0

I'm new to using the spring gem and have been impressed at how it has made my tests run quicker. I've followed the documentation:

  1. Included the spring and spring-command-rspec gems in the development and test groups

  2. ran $ bundle install

  3. ran $ bundle exec spring binstub --all

I have direnv, so can type rspec and it runs it with spring. So when I do

rspec ./spec/path/to/file_spec.rb

It runs it much quicker! Should I be expecting the same behaviour when I run:

$ rspec ./spec/

Because currently, it runs at the same speed as when I run it without spring.

Any pointers and advice would be appreciated, thanks.

  • 1
    Tests, which can fail unpredictably, are far more likely to cause problems with spring. Unless your test suite takes a VERY long time to run then I wouldn't recommend using it -- the first time you spend half a day troubleshooting a spec only to find it's because spring kept something in memory is the last time you'll use spring. – anothermh Sep 03 '20 at 21:49
  • thanks for replying @anothermh, and for the warning. Thing is, my rspec suite takes far too long at the moment. Without spring, it takes 15 seconds to load a random test file whilst with spring it goes down to 2 seconds. I think it might be my Mac (which is slow). I'm unsure if I should continue with spring and risk tests @£$%! me off or go without it and look at getting a new mac :( – Karim Timer Sep 04 '20 at 09:42

0 Answers0