Released: Sep 15, 2009, Running time: 14 min
In this episode:
Installing and configuring Spork to make RSpec and Cucumber load specs and features faster.
FREEWatch episodeDownloads
| Item | Size |
|---|---|
| Quicktime (MP4) | 91.25 MB |
| iPhone | 28.99 MB |
Released: Sep 15, 2009, Running time: 14 min
In this episode:
Installing and configuring Spork to make RSpec and Cucumber load specs and features faster.
FREEWatch episode| Item | Size |
|---|---|
| Quicktime (MP4) | 91.25 MB |
| iPhone | 28.99 MB |
Spork is a tool used to preload your environment so you don’t have to load it each time you run your features or specs.
URLAgg – http://github.com/jschoolcraft/urlagg – is a project built with Ruby on Rails, having 198 RSpec examples and 548 Cucumber steps in 90 scenarios.
We use Spork to reduce the startup time for running specs and features for URLAgg with autospec.
A couple of gotchas come up as we add Spork to our initialization files and you can see how to go around them.
Also, for Textmate users using the RSpec bundle, a quick tip on how to use Spork when running features from within Textmate.
You can read more about using Spork on the Github wiki for Cucumber and on the Spork homepage.
7 comments
Ray
10 months ago
I’ve been trying to apply this to Brandizzle. Here’s where I’m stuck. Spork doesn’t seem to load factory-girl properly:
Istvan Hoka
10 months ago
Make sure you have something like this in your cucumber.rb environment file.
To debug the requirement of factory_girl, you could run “script/console cucumber” and “Factory.create(:brand)”.
Matijs van Zuijlen
10 months ago
I get the impression that most of the work after choosing to use Spork is working around Spork breaking things, or changing how RSpec works. It’s hardly a drop-in solution.
Istvan Hoka
9 months ago
In reply to Matijs van Zuijlen
I get the impression that most of the work after choosing to use Spork is working around Spork breaking things, or changing how RSpec works. It’s hardly a drop-in solution.
You are right, it really is not a drop-in solution. For smaller projects it is probably not worth the hassle of setting it up. But when you reach a certain number of steps and specs in your project, the benefit of speeding up the load time outweighs the hassle of setting it up.
Andrew Vit
6 months ago
How does `AUTOFEATURE=true autospec` connect to drb for both cucumber and rspec? Do you run two instances of spork for this?
Istvan Hoka
6 months ago
In reply to Andrew Vit
How does `AUTOFEATURE=true autospec` connect to drb for both cucumber and rspec? Do you run two instances of spork for this?
Yes, I load spork in two terminal tabs:
Joseph DelCioppio
5 months ago
When I run spork rspec I always get the message
bc. No server is running
Running specs locally:
Which I don’t understand. What is spork trying to tell me?