An important note: On future versions, the resolution of when's promises will always happen on the next turn (via `setImmediate`, `process.nextTick` etc), so these tests would probably fail. To be future proof, it's better to not count on handlers being called synchronously with the `resolve()` call. An alternative could be something like this:

```js
when.map([0, 1, 2, 3], guard(2).do(function(v) {
  // Current code
})).then(function() {
  // First assertion
  dfds[1].resolve();
  return dfds[1].promise;
}).then(function() {
  // Second assertion
}).always(done);
```