From: Austin Ziegler Date: 2007-02-20T03:49:14+09:00 Subject: Re: Assertions Testing in irb On 2/19/07, Bharat Ruparel wrote: > Ok, then there has to be "recommended" way to "invoke" the unit testing > functionality in irb. Yes. The recommended way is "don't." Unit tests are things that are designed to be repeatable and related to classes that you're building. Simply using the assertions gains you absolutely nothing with respect to using IRB itself. > I find irb extremely useful in learning ruby. > Also, I am loading file(s) in irb all the time, so "load is rarely used" > does not make much sense to me. Use "load" when you want to reread the classes you're working with from disk. Otherwise, forget that it exists. > Also, I am a bit puzzled over why I > cannot "load" a ruby built-in fuctionality into irb (such as unit > testing). You tried "load Test::Unit" (or "load 'Test::Unit'"); this won't work because load doesn't work that way. Doing 'load "test/unit"' won't work, either, because Ruby doesn't dynamically resolve the extension. Doing 'load "test/unit.rb"' does. > Note that I don't have a particular preference for using load > versus require. You should. -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca