Thomas Sndergaard <tsondergaard / speakanet.com> wrote in message news:<DFC899CCE177624AB6A2F121DD0CC976B5A0 / granada.speakanet.com>...
> I have a ruby module with about 1100 lines of code and another 1700 of unit tests. This gives me good confidence, but I would really like to know how much of the code is covered by tests.
>  
> Is there a code coverage analysis tool for ruby? Something like OptimizeIt CodeCoverage for Java.

I haven't heard of an automated coverage analysis tool

However, I have a neat idea:

Today I did a bit of coverage analysis by hand.  I uncommented the
lines of a method one at a time, running the tests between each bit. 
This let me discover exactly which lines were tested and which lines
untested.  While doing it, I couldn't help the feeling that this
simple process could have been automated.

This could be the basis for a simple coverage analysis tool.  It could
read in the source, comment out the code, and uncomment lines one at a
time.  You'd need a bit of regexp intelligence so that it would know
to uncomment both ends things like if...end, etc.  It could then
produce a report of those lines that had no effect on the results of
the test suite (filtering for white space).

~ Patrick