Script and makefile adjustments for updating extlib
[larjonas-mediagoblin.git] / extlib / leaflet / spec / suites / geometry / PointSpec.js
blobd004d60bf68a029fc14bc74251f6549448b2078a
1 describe("Point", function() {
3 describe('constructor', function() {
5 it("should create a point with the given x and y", function() {
6 var p = new L.Point(1.5, 2.5);
7 expect(p.x).toEqual(1.5);
8 expect(p.y).toEqual(2.5);
9 });
11 it("should round the given x and y if the third argument is true", function() {
12 var p = new L.Point(1.3, 2.7, true);
13 expect(p.x).toEqual(1);
14 expect(p.y).toEqual(3);
15 });
16 });
18 describe('#subtract', function() {
19 it('should subtract the given point from this one', function() {
20 var a = new L.Point(50, 30),
21 b = new L.Point(20, 10);
22 expect(a.subtract(b)).toEqual(new L.Point(30, 20));
23 });
24 });
26 describe('#add', function() {
27 it('should add the given point to this one', function() {
28 expect(new L.Point(50, 30).add(new L.Point(20, 10))).toEqual(new L.Point(70, 40));
29 });
30 });
32 describe('#divideBy', function() {
33 it('should divide this point by the given amount', function() {
34 expect(new L.Point(50, 30).divideBy(5)).toEqual(new L.Point(10, 6));
35 });
36 });
38 describe('#multiplyBy', function() {
39 it('should multiply this point by the given amount', function() {
40 expect(new L.Point(50, 30).multiplyBy(2)).toEqual(new L.Point(100, 60));
41 });
42 });
44 describe('#distanceTo', noSpecs);
45 });