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.

Related posts:

  1. Solving Lisp's problem: a simplistic solution with make
  2. Cleaning up a Debian GNU/Linux
  3. The lambda revolution, Episode V, the deb strikes back
  4. Another simplistic solution, with SCons

About J. Pablo Fernández

http://pupeno.om
This entry was posted in tutorial and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre user="" computer="" escaped="">