hey, thanks for reading:
I have a problem which can be reduced to this,
from within an example of mine I call the helper 'expect_call' which is
defined thus:
def expect_call(*hash*)*
*obj.should_receive(:some_
method).with(*hash*)*
*end
and in one of my examples the 'expected' hash is strictly defined as follows
expect_call(*{
:some_key => [1,2,3]
}*)
however my spec fails because it is actually called with
*{
:some_key => [1,3,2]
}
*or maybe
*{
:some_key => [2,3,1]
}
*or
*{
:some_key => [2,1,3]
}
*i.e. the array part is not in the order i 'expect' BUT i don't actually
care about the order. So I would like to be able to change my one example to
something like this:
expect_call(*{
*:some_key => [1,2,3]*.ignoring_order
}*)
does such a concept exist or do I have to change the implementation of
expect_call to use some sort of custom matcher - I am reluctant to do this
since this method is called in other cases where maybe (for arguments sake)
I DO care about array ordering within the hash.
Hope someone can solve this for me - MUCH appreciation.
James
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users