okcy3g
Last Updated: February 25, 2016
·
1.573K
· job
Bc8cd27a964b28bc06d5ad8020822b1c

Turbo Testing with Spring

You want to speed up your Rails tests by preloading your application, but you're always fighting with Spork or Zeus? Spring is easy and requires almost no setup!

You just need to install the spring gem

gem install spring

And then create a little binstub for your favourite test flavour

spring binstub rspec

spring binstub cucumber

spring binstub testunit

Now just run your tests by calling the just-created scripts

bin/rspec

bin/cucumber

bin/testunit

You'll see you test speed has increased quite a bit, without having to create fragile configurations for the specificities of your application.

The spring gem is still in Alpha and you should definately check it out here:
https://github.com/jonleighton/spring

Say Thanks
Respond

2 Responses
Add your response

8672
64fa0c156c8c444cbbe09593baea6e3e

Great post, thanks! Does it work with guard for testing changed files?

over 1 year ago ·
8673
Bc8cd27a964b28bc06d5ad8020822b1c

I didn't try it, but I suppose it does. The change to your Guardfile should be minimal: replace any call to rspec or cucumber with bin/rspec and bin/cucumber.

over 1 year ago ·