cjohansen/Sinon.JS — pull request #445 by reimund (2014-03-30 22:49:33+00:00)
Title: Matching multiple arguments at once

These two commits makes it possible to match multiple arguments with a single matcher.

The first commit makes the following scenario work:

```javascript
var obj = { foo: function() { }};
var ex = sinon.mock(obj).expects('foo');

obj.foo('bar', 'abc', 123);

sinon.assert.calledWith(ex, sinon.match(function(arg1, arg2, arg3) {
return 'bar' == arg1
&& 'abc' == arg2
&& 123 == arg3;
}));
```

The second commit makes this, slighly less verbose, example work:

```javascript
var obj = { foo: function() { }};
var mock = sinon.mock(obj);

mock.expects('foo').once()
.withArgs(sinon.match.all(function(arg1, arg2, arg3) {
return 'bar' == arg1 && 'abc' == arg2 && 123 == arg3;
}));

obj.foo('bar', 'abc', 123);
```