Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jashkenas/underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Feb 11, 2014
2 parents 32216a4 + df63b65 commit b5f074f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@
<li>- <a href="#clone">clone</a></li>
<li>- <a href="#tap">tap</a></li>
<li>- <a href="#has">has</a></li>
<li>- <a href="#matches">matches</a></li>
<li>- <a href="#property">property</a></li>
<li>- <a href="#isEqual">isEqual</a></li>
<li>- <a href="#isEmpty">isEmpty</a></li>
Expand Down
15 changes: 8 additions & 7 deletions test/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,14 +587,15 @@
ok(_.has(obj, "foo"), "has() works even when the hasOwnProperty method is deleted.");
var child = {};
child.prototype = obj;
ok(_.has(child, "foo") == false, "has() does not check the prototype chain for a property.")
ok(_.has(child, "foo") == false, "has() does not check the prototype chain for a property.");
});

test("matches", function() {
var moe = {name: 'Moe Howard', hair: true},
curly = {name: 'Curly Howard', hair: false},
stooges = [moe, curly];
ok(_.find(stooges, _.matches({hair: false})) === curly, "returns a predicate that can be used by finding functions.")
ok(_.find(stooges, _.matches(moe)) === moe, "can be used to locate an object exists in a collection.")
})
var moe = {name: 'Moe Howard', hair: true};
var curly = {name: 'Curly Howard', hair: false};
var stooges = [moe, curly];
ok(_.find(stooges, _.matches({hair: false})) === curly, "returns a predicate that can be used by finding functions.");
ok(_.find(stooges, _.matches(moe)) === moe, "can be used to locate an object exists in a collection.");
});

})();

0 comments on commit b5f074f

Please sign in to comment.