[rspec-users] Applying an rspec matcher against the elements of a collection

Michael Guterl mguterl at gmail.com
Tue Feb 23 20:26:57 EST 2010


On Tue, Feb 23, 2010 at 4:43 PM, Pat Maddox <mailinglists at patmaddox.com> wrote:
<snip>
>
> there is also the set equality matcher, which checks that the contents of two collections are equal irrespective of order:
>
> voters.should =~ [bob, sally]
>

I can't believe I didn't know =~ could be used for comparing
collections regardless of order, this is awesome!

Thanks,
Michael Guterl


More information about the rspec-users mailing list