From: Rick DeNatale Date: 2007-09-05T04:07:01+09:00 Subject: Re: Embedded vs. Non-embedded Tests On 9/4/07, Trans wrote: > As far as I know, Facets is the only large project that uses embedded > unit tests. The tests are housed in block comments, eg. > > =begin test > ... > =end > > I have a command line tool that can run the embedded test directly. > For deployment, I have another tool that extracts all the embedded > tests and copies them to stand-alone test/ files so others can run > them. It works fairly well. And the advantage of course is that the > unit tests are right there with the libs they test. > > However, considering that just about everyone else is putting units > test in their on test files, I'm wondering if I actually missing out > on superior advantages to that approach. If not why haven't others > pursued better tools for supporting embedded tests? I think that you're swimming against the tide. Personally, it just feels right to me to separate the test code from the code under test, most test equipment belongs in the garage instead of the trunk of the car. And when it gets beyond just unit testing individual classes, it's not apparent to me which file an embedded test should call home. From a practical tool perspective, there are lots of things which expect a relationship between code files and test files. Two which spring immediately to mind are autotest and rcov. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/