From: "David A. Black" Date: 2005-11-15T01:18:57+09:00 Subject: Re: Putting unit test cases in the code - RDoc & UnitTest Hi -- On Tue, 15 Nov 2005, listrecv@gmail.com wrote: > David, > > That's a great idea. The only problem is that, let's say FileA and > FileB both require FileC. We'd like to run the unit tests for each > file separately, and certainly not more than once. With your code, > they'll get run recursively, each time they're required. They shouldn't run at all from any require'd file, because the $0 == __FILE__ test won't pass in that file. > But maybe I could add > if ENV["RUN_TESTS"} && $0 == __FILE__ ? > > Would that do it? And I guess then RDoc would see the class and doc it > (it'll ignore the if statement wrapping it, I assume). If it gets that complex you might want to use Rake and set up a test target. That might be more scaleable. David -- David A. Black dblack@wobblini.net