“You should spend at least half of your time in the ‘test’ directory.” — Jeremy Voorhis
“Quit looking at your web browser!” — Eric Hodel
Web development without a browser?
sudo gem install ZenTest
Autotest runs continuously and watches to see what files you have edited. Any time you save a file, it will run the corresponding test within a few seconds. If a test fails, you can see the result immediately. If it passes, you can write another test, then the code necessary to make it pass, ad nauseam.
# Run this inside your Rails app's directory topfunky$ autotest -rails
The revolutionary part of this is that it speeds development by helping you develop without needing to open your web browser! I find myself thinking more about the functional issues that need to be solved rather than the placement of an image or the color of a link.
And since it’s running continuously, you don’t have to wait for your tests to run…they are running almost all the time. When they do run, they often take less time since autotest intelligently diffs the change and runs the test for a single method, when possible.
It makes it hard NOT to do test-driven development. You see the screen sitting there like a hungry fire waiting for another test. Like a fire, it also has an infinite hunger, so you will never beat it.
But the point is…by writing tests you can
ZenTest also has other tools, but I’m definitely grooving with autotest.