Using Zeus with Cucumber and Guard
Zeus is rapidly overtaking Spork as the tool of choice to speed up running Cucumber integration tests against Rails apps.
I wanted to use Zeus alongside Guard to provide a rapid feedback cycle when doing BDD. This ended up being quite fiddly to get working, and it seems not many people are doing this yet, so here I will describe my configuration.
These instructions are for Mac OS X 10.8. On other platforms you’ll probably need to pick different gems for notifications and filesystems events.
Gemfile
Zeus seems to be picky about which groups it loads gems from, depending on what command you’re running. The configuration below works for me, but may not be optimal:
I’ve specified versions to show which combination worked for me. As some of these gems need to interact closely with each other, you need to be careful when upgrading in order to keep them ‘in sync’.
Note that the Zeus gem is listed in the :test
group, even though I’m not running Zeus through Bundler. I’m not entirely sure why it has to be here, but I get an error zeus is not part of the bundle when it’s not present.
Guardfile
My Guardfile is fairly standard. guard-rspec already has support for Zeus, so all I had to do was enable zeus
and disable bundler
:
guard-cucumber doesn’t have built-in support for Zeus, but the command_prefix
setting can be used instead:
Booting Up
Start Zeus without using Bunder:
Then start Guard via Bundler:
Now you can start building!