From: Luis Parravicini Date: 2008-10-02T03:07:45+09:00 Subject: Re: Ordered hash hack for < ruby 1.9? On Wed, Oct 1, 2008 at 3:00 PM, Ben Johnson wrote: > I am having an issue testing my code because hashes don't have a > consistent order when you iterate over them. For example, one of the > methods that I am trying to test iterates over a hash and creates a > string. That string is in a different order every time, and my tests > keep failing. > > What would be perfect is if I could modify how the Hash class works so > it preserves the insert order, but only when I am testing. So I could > include this file in my tests. > > Is there anything out there that does this? Thanks for your help. Hash's == method compares if two hashes are equal ( http://www.ruby-doc.org/core/classes/Hash.html#M002875 ) Bye -- Luis Parravicini http://ktulu.com.ar/blog/