On Aug 18, 2008, at 11:10 AM, Matt Wynne <[EMAIL PROTECTED]> wrote:
Hi folks,
I have an object whose constructor I want to stub, specifying that
it should be passed a hash containing an expected set of key / value
pairs.
Note that the actual hash might contain more key / value pairs,
Okay, I realised the with() is calling the == method on whatever you
pass in, so I did this:
module EquateAnyHashContainingAllMyElements
def ==(other)
self.keys.all? do |key|
other.has_key?(key)
end
end
end
ex
Hi folks,
I have an object whose constructor I want to stub, specifying that it
should be passed a hash containing an expected set of key / value pairs.
Note that the actual hash might contain more key / value pairs, but I
don't care, as long as my expected ones are there
I thought I migh