At Fri, 2 Aug 2002 18:33:59 +0900, Philipp Meier wrote: > On Fri, Aug 02, 2002 at 08:35:32AM +0900, GOTO Kentaro wrote: > > > There is another story if `require' is put in def statement. Inside > > of def would not be evaluated until the method is invoked. So require > > in def can postpone loading a library file until really needed. That > > may improve average performance in some cases. > > ...and make debugging harder. But aren't we all doing unit testing? :) :) By the way, unit testing is big fun but useful only if that testing is done thoroughgoingly. For example, a bug by require-in-def would be missed detecting if the method is skipped in a test. Now, I wrote a coverage testrunner, subclass of Test::Unit::UI::CONSOLE::TestRunner: http://www.notwork.org/~gotoken/ruby/p/as-is/testrunner_coverage.rb This is very ad hoc one but I found some missing tests by this toy. Test first? I know I know... but I often forget it ;) More sophisticated coverage test may help the unit test to complete? (#) (#) NaHi told me this idea, not mine.