[rspec-users] Someone please name this matcher for me

Jonathan Linowes jonathan at parkerhill.com
Wed Aug 6 14:06:19 EDT 2008


perhaps verbose but how about

	foo.should equal_in_any_order [1, 3, 1, 4, 2]


On Aug 6, 2008, at 1:50 PM, Pat Maddox wrote:

> I've had a matcher in my head for a couple months, that I frequently
> want but never get around to writing because I can't think of the name
> for it.  Here's how it would look
>
> [1, 2, 3, 4, 1].should ... [1, 3, 1, 4, 2]
>
> I have a couple ideas for names, but I'll hold off on them so I don't
> influence anyone's opinion.
>
> btw, I realize that .sort works in this case.  But that's slightly
> less clear than I'd like, and it doesn't work for non-Comparable
> objects (like activerecords).
>
> Pat
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list