[rspec-users] Spec/Test Speed

Scott Taylor mailing_lists at railsnewbie.com
Wed Oct 3 23:40:27 EDT 2007

Just wanted to pick some smart people about this topic: What are you  
guys doing to increase the speed of your specs?

I'm a big fan of autotest, but right now my current project has 438  
specs (for rails).  Most of them are in the model, and for all of  
them we are hitting the database (they are more functional specs than  
unit-tests).  The whole suite takes 112 seconds (meaning the red to  
green cycle leaves me learning how to juggle, just like Jim Weirich  
with make).  Any recommendations, short of mocking/stubbing to get  
around this?  Some of the suggestions I've heard are:

- In Memory Database w/ Sqlite.  As far as I know, no one has gotten  
this to work (with rspec, at least)
- Using faster hardware.  I don't have the budget right now for a  
better machine.  One interesting idea is this one: http:// 
www.dcmanges.com/blog/deep-test-preview, although as far as I know,  
it doesn't work for rspec.
- Only running specs per file, and using continous integration to do  
the rest.  Right now this isn't an option for testing my User model,  
which has 92 examples, and takes 20 seconds.  Also, I'd really rather  
not commit before I know the whole test suite passes
- Other ideas?


More information about the rspec-users mailing list