LearnBoost/expect.js — pull request #69 by mileskin (2013-09-02 20:56:46+00:00)
Title: Add means for checking that expected objects are contained in the actual array (order doesn't matter)

Quite often it's necessary to check that some items (objects/strings/arrays etc.) are found in the actual array. With this patch things become really easy. Previously there was only `contain` which doesn't support deep equal check for objects. Now there's `containAll` for checking multiple items at the same time and `containEql` for checking only one item.

When using `containAll` the order of the items doesn't matter. This is great especially when the test can't affect the order that production code provides.

Example from our app spec where the order of items are shuffled by production code:
```coffeescript
winnings = _.map $('#winning-news li'), (li) ->
[$(li).find('.location').text(), $(li).find('.amount').text()]
expect(winnings).to.have.length(3).and.to.containAll([
['Espoo', '10 €']
['Helsinki', '323 €']
['Tampere', '59,20 €']
])
```