visionmedia/should.js — comment on commit 49fbf78d51d2d53d599695c193b92e65a48bd9c8
File:  line 0
By lackac:

@quangv,just put this in your `test_helper.js` or something that you require in all your test files:

``` javascript
var should = require('should')
, eql = require('should/lib/eql')
, i = require('util').inspect;

should.Assertion.prototype.object = function(obj) {
this.obj.should.be.a('object');
var included = true;
for (var key in obj) {
if (obj.hasOwnProperty(key) && !eql(obj[key], this.obj[key])) {
included = false;
break;
}
}

this.assert(
included
, 'expected ' + this.inspect + ' to include ' + i(obj)
, 'expected ' + this.inspect + ' to not include ' + i(obj)
);

return this;
}
```