Skip to content

Commit

Permalink
Fix TypeError in .containEql with checking that property exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
btd committed Feb 25, 2014
1 parent cc7e885 commit a5d708d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ext/property.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ module.exports = function(should, Assertion) {
} else if(util.isObject(obj)) {
// object contains object case
util.forOwn(other, function(value, key) {
obj[key].should.eql(value);
obj.should.have.property(key, value);
});
} else {
//other uncovered cases
Expand Down
2 changes: 2 additions & 0 deletions test/ext/property.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ module.exports['property'] = {
[{a: 'a'}, {b: 'b', c: 'c'}].should.containEql({a: 'a'});
[{a: 'a'}, {b: 'b', c: 'c'}].should.not.containEql({b: 'b'});

({}).should.not.containEql({ a: 10 });

({ b: 10 }).should.containEql({ b: 10 });
[1, 2, 3].should.containEql(1);
([1, 2, { a: 10 }]).should.containEql({ a: 10 });
Expand Down

0 comments on commit a5d708d

Please sign in to comment.