Quick and dirty continuous testing with Ruby on Rails

I like the idea of continuous testing: seeing that you broke it, the moment you broke it and the same for fixing. There are some tools to do it, but since they are not packaged, yet, for my operating system of choice I went through the quick and dirty route:

watch -n 5 rake test 2> /dev/null

“watch” is a nice program that can run another program every two seconds continuously. I often use it like this:

watch ls -l big-file-being-copied.txt

to see how a long file-system-process is going. Using the parameter “-n 5″ I tells it to run every 5 seconds because 2 seconds is too short for running all the tests of my application. You should change it according to your testing times.

The last part, “2> /dev/null”, is to avoid getting stderr output from “rake test”, it confuses watch.

Some notes before I get the messages I know I might get. I know there’s an easy way to install ZenTest with gems, but so far I couldn’t make it work nicely with the operating system packages. And I like the operating system packages, I don’t want to remove them all and just use gems. If you want to learn more about ZenTest’s autotest, there’s seems to be a nice post: autotest-rails.

You may also like:


Leave a Reply

Hi, I'm Pablo, this is my web site. You can follow me or connect with me:

Or get new content delivered directly to your inbox.

Join 4,025 other subscribers

I'm writing a book

Stack of copies of How to Hire and Manage Remote Teams

How to Hire and Manage Remote Teams, where I distill all the techniques I've been using to build and manage distributed teams for the past 10 years.

I write about:

announcement blogging book book review book reviews books building Sano Business C# Clojure ClojureScript Common Lisp database Debian Esperanto Git history idea Java Kubuntu Lisp music Non-Fiction OpenID programming Python Rails rant re-frame release Ruby Ruby on Rails Sano science science fiction security self-help Star Trek startups technology Ubuntu video web Windows WordPress

I've been writing for a while:

%d bloggers like this: