Seems like rather this code could be improved by using [`_.every`](http://underscorejs.org/#every):

```js
toHaveAttrs: function(attrs) {
  if ($.isEmptyObject(attrs)) {
    return false;
  }
  var element = this.actual;
  return _.every(attrs, function(value, name) {
    return element.attr(name) === value;
  });
```