From: Brian Candler Date: 2008-09-16T20:49:11+09:00 Subject: Re: getting an array of unique objects of a class i wrote Adam Akhtar wrote: > Thank you everyone for your reply. Ive implemented the hash and eql? > definitions for my class and it worked. On a similiar note what do i > have to do for my unit tests which compare two objects to work. > > I.e. > > assert_equal(expected_object, some_method_which_returns_an_object()) Look at the source for assert_equal :-) /usr/lib/ruby/1.8/test/unit/assertions.rb def assert_equal(expected, actual, message=nil) ... assert_block(full_message) { expected == actual } So your object needs to implement '==' too. -- Posted via http://www.ruby-forum.com/.