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

Jonathan Linowes jonathan at parkerhill.com
Wed Aug 6 15:04:07 EDT 2008


.should be_bag_of( [1, 3, 1, 4, 2] )

On Aug 6, 2008, at 2:33 PM, Steve Schafer wrote:

> On Wed, 6 Aug 2008 13:50:27 -0400, you 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]
>
> An unordered collection with possibly multiple occurrences of its
> members is known in mathematics as a "multiset," or, informally, a
> "bag."
>
> -Steve
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list