From: Massimiliano Mirra Date: 2002-03-20T23:51:23+09:00 Subject: Re: another Test::Unit question On Wed, Mar 20, 2002 at 12:05:32PM +0900, Nathaniel Talbott wrote: > > If the __FILE__ == $0 part goes away, would the test run > > always? Would it have to be kept in a separate file? > This would still work fine, and would remain a perfectly valid way *relief* :-) > doing things. The enhancement I was talking about would simplify life > for those (like myself) that keep tests and code in separate files, by > keeping them from ever having to specify __FILE__ == $0 in the test file > to get the tests to execute using their choice of runner. Ok. > One question, > out of curiosity: how do you roll up a set of tests so that you can run > them all at the same time? It seems that the tests don't even exist > unless you're actually executing the file with the test in it. Do you > ever run all the tests at once? I don't usually run more than one file's tests at a time. To accomplish and still keep this approach, I'd probably have a for loop in a make file (for file in lib/*.rb; do ruby $file; done) or set a global variable: $TESTING = true require 'file1' require 'file2' [run tests] if __FILE__ == 0 or $TESTING require 'test/unit' ... end Massimiliano