Script and makefile adjustments for updating extlib
[larjonas-mediagoblin.git] / extlib / leaflet / spec / suites / geometry / BoundsSpec.js
blobeee05e4bf2675dc169ca603eb5d0a43ad42d1405
1 describe('Bounds', function() {
2 var a, b;
4 beforeEach(function() {
5 a = new L.Bounds(
6 new L.Point(14, 12),
7 new L.Point(30, 40));
8 b = new L.Bounds([
9 new L.Point(20, 12),
10 new L.Point(14, 20),
11 new L.Point(30, 40)
12 ]);
13 });
15 describe('constructor', function() {
16 it('should create bounds with proper min & max on (Point, Point)', function() {
17 expect(a.min).toEqual(new L.Point(14, 12));
18 expect(a.max).toEqual(new L.Point(30, 40));
19 });
20 it('should create bounds with proper min & max on (Point[])', function() {
21 expect(b.min).toEqual(new L.Point(14, 12));
22 expect(b.max).toEqual(new L.Point(30, 40));
23 });
24 });
26 describe('#extend', function() {
27 it('should extend the bounds to contain the given point', function() {
28 a.extend(new L.Point(50, 20));
29 expect(a.min).toEqual(new L.Point(14, 12));
30 expect(a.max).toEqual(new L.Point(50, 40));
32 b.extend(new L.Point(25, 50));
33 expect(b.min).toEqual(new L.Point(14, 12));
34 expect(b.max).toEqual(new L.Point(30, 50));
35 });
36 });
38 describe('#getCenter', function() {
39 it('should return the center point', function() {
40 expect(a.getCenter()).toEqual(new L.Point(22, 26));
41 });
42 });
43 });