Last week, Edward Anderson introduced me to this video on zeus.
Let me say, that there is a tremendous difference in the speed in which my test suite has been running ever since. So lets go over a quick install for
guard-rspec. These are the two gems that Edward showed me how to use to get blazing fast console, rake, and server speeds.
The order of the Gemfile’s
:development & test groups actually made a difference. Before my Gemfile looked like what you see above, I had my
shoulda and shoulda-matchers gems at the bottom of the group. The helpers that come with the gems didn’t want to run properly until Edward pointed out that gem order makes a difference, and had me adjust the order to the above image.
I don’t understand everything thats going on inside of this file, but I think the broad jest is that these different commands starting with guard, give zeus a file path to watch over. Here’s an example that can explain the folder paths a little better than I could write it.
The if we refer to the github repositories of both the
guard-rspec gems, its the terminal command
guard init zeus for guard-zeus and
guard init rspec for guard-rspec that will generate the associated commands for our Guardfile. I showed you the
guard-zeus guard commands, so here is the command list that zeus will use to run Rspec specs.
Don’t worry, running zeus isn’t complicated at all. In fact, its just as easy as running our specs the old-fashioned way
Start your engines!
Getting guard and zeus going is pretty simple. First you’ll want to open a terminal session and change directory into your desired application folder root. Then you’ll want to type
bundle exec guard. Pretty simple! If everything went well your terminal window should look something like this:
Next we can leave this window running guard for us and type
command + t to bring up an new terminal window that we need to change to our app’s root folder as well. Once there you’ll want to type
zeus start. This brings up a color coded display that looks something like:
And finally, we can open yet another terminal window, and if we already have some specs written, take zeus out for a test drive like so.
zeus test spec/path_to/your_spec(s).rb.
And for those of you who have watched the zeus video at the beginning of this post, here’s the clocked speed from running my model specs.
Under a second! Just like the good gentleman in the top-hat says.
If you’re interested in getting these gems setup for your environment, check out the pair with Edward and I. Or better yet, get in touch with him and schedule an hour to try AirPair for yourself. I can honestly say that I have grown leaps and bounds in only a few weeks of consistent pairing and working on my own in between.