On Mon, May 20, 2002 at 10:04:07PM +0900, Dave Thomas wrote:
> In (say) Java, people tend to keep the unit tests in separate files. I
> think this is for two reasons. First the tests add bulk to the class
> files. Second, the additional verbiage in Java means the tests obscure
> the meaning of the code.
> 
> Neither of these apply to Ruby, and yet we still tend to put the unit
> tests in a separate file. So I'm wondering what happens it we break
> that tradition:
> ...
> I'm still not sure about this - what do folks think?

Dave,

My test/code ratio usually falls between 1:1 and 2:1 (I just measured
one project I'm working on; the ratio there is 1.6 lines of test per 1
line of code).  That's a lot of test code, much of which is not for
documentation, but is to cover edge cases, create mock instances of
other classes, etc.  It seems to me that my classes would become less
clear when packaged with that much bulk.

It's probably the case that I'm not all that good at testing yet, but
until I get much more concise, embedding the tests with the code would
be a bad idea for me.

        Wayne Conrad