On 2/19/07, Austin Ziegler <halostatue / gmail.com> wrote: > On 2/19/07, Bharat Ruparel <bruparel / mercury.com> wrote: > > > include Test::Unit::Assertions > > > > > > That will include them in Object and you can use them that way. > > > > > > I'm not sure I recommend this, though. > > > > > > -austin > > > > I did that and it works! Thanks. Why are you saying that you have > > 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