Polymorphism

This commit is contained in:
John Firebaugh
2012-12-28 22:24:52 -08:00
parent f7dfda46b2
commit d181df4c51
7 changed files with 46 additions and 20 deletions
+6
View File
@@ -21,6 +21,12 @@ describe('iD.Node', function () {
expect(iD.Node({tags: {foo: 'bar'}}).tags).to.eql({foo: 'bar'});
});
describe("#extent", function() {
it("returns a point extent", function() {
expect(iD.Node({loc: [5, 10]}).extent()).to.eql([[5, 10], [5, 10]]);
});
});
describe("#intersects", function () {
it("returns true for a node within the given extent", function () {
expect(iD.Node({loc: [0, 0]}).intersects([[-180, 90], [180, -90]])).to.equal(true);