Adding test spec.

This commit is contained in:
Tim Schaub
2012-06-18 18:15:51 +02:00
parent 62f3f70910
commit b9d690044f
9 changed files with 3650 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
describe("ol.Bounds", function() {
it("allows flexible construction", function() {
var bounds, proj;
// array with min/max
bounds = ol.bounds([1, 2, 3, 4]);
expect(bounds.minX()).toBe(1);
expect(bounds.minY()).toBe(2);
expect(bounds.maxX()).toBe(3);
expect(bounds.maxY()).toBe(4);
// object config
bounds = ol.bounds({
minX: 9, maxX: 10, minY: 11, maxY: 12,
projection: ol.projection("bar")
});
expect(bounds.minX()).toBe(9);
expect(bounds.maxX()).toBe(10);
expect(bounds.minY()).toBe(11);
expect(bounds.maxY()).toBe(12);
proj = bounds.projection();
expect(proj instanceof ol.Projection).toBe(true);
expect(proj.code()).toBe("bar");
});
});