I cleanup up my semi-automagic test generator and xmp filter for Ruby, and added some
code to make it win32-friendly*1.
If you missed it
the first times
I wrote about it:
xmpfilter.rb is basically a source code filter than generate assertions for your
tests, and annotate the code to show intermediate results. This picture
illustrates the former:
The code on the right of the above picture was generated by
xmpfilter.rb -u code.rb
This can save quite some typing when you're adding regression tests, or when
you're developing the code and the tests in parallel. It can (and should) be
used incrementally: you expand the assertions once and then keep editing
the generated code (not the original one!), repeating this as many times
as needed while you're writing the tests --- think of it as an intelligent
kind of macro expansion. It should only take about 1 keypress under a sane
editor (I show how to do it with vim below).