From: Rick DeNatale Date: 2007-06-13T23:08:28+09:00 Subject: Re: Unit testing idiom On 6/13/07, Alex Young wrote: > Hi all, > > It's always bothered me having code and unit tests in different places - > keeping unit tests near the code they are testing *has* to be a good > thing, right? I don't know that I agree with your premise. While it might seem convenient to combine tests with the artifacts they test, in general I think that separating them is a good thing. Having separate tests acts as a sort of double-entry bookkeeping system. If they are combined there's the possbility of 'cooking the books' either deliberately or unintentionally. For simple things, such as trying something out, or demonstrating your ruby-foo on posts here, combining the tests and code being tested might be alright, but I think it's an idea best used in moderation. For anything larger, I'd advocate for setting up a system for locating the test code, such as the directory structure used by Rails. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/