Rob Sanheim wrote: > On 2/19/07, Austin Ziegler <halostatue / gmail.com> wrote: >> > doubts about recommending something that gets the job done? >> >> I don't recommend using Test::Unit assertions in IRB. > > If the OP wants to try out assertions in IRB, what is the problem? > Its a perfectly good way to get used to the API, the different ways > you can assert something, etc. Thats one perfectly valid way to use > IRB. If the OP asked "how do I write an automated test suite in > IRB?", then I can see a reason for concern. =) > > Bharat: a better way to use assertions inside IRB would be to create a > helper object and include them into that, and then load that into your > .irbrc. This avoids polluting the top level namespace in irb and is > recommended if you want to use assertions often in irb. For example: > > class TestHelper > include Test::Unit::Assertions > end > > then inside irb, you can do: >> test_helper = TestHelper.new >> test_helper.assert_equal(4, 2+2) > > - Rob Just what the doctor ordered! This is what I call: have your cake and eat it too! Works! Go IRB!!! Thanks Rob. Regards, Bharat -- Posted via http://www.ruby-forum.com/.