diff options
author | Joar Wandborg <git@wandborg.com> | 2012-01-28 18:47:01 +0100 |
---|---|---|
committer | Joar Wandborg <git@wandborg.com> | 2012-01-28 18:47:01 +0100 |
commit | 3d0d3bc97270095fae5f9a2508068631c46a5e61 (patch) | |
tree | 76778fcacaae35fc5662f276dab512a07bcee186 /extlib/leaflet/spec/suites/geometry/PointSpec.js | |
parent | d7bec8577ea1b4d83df097f586324445fed1ef50 (diff) | |
parent | 9542a2ba076b7e00e79d7adb1a4e90a095427645 (diff) | |
download | mediagoblin-3d0d3bc97270095fae5f9a2508068631c46a5e61.tar.lz mediagoblin-3d0d3bc97270095fae5f9a2508068631c46a5e61.tar.xz mediagoblin-3d0d3bc97270095fae5f9a2508068631c46a5e61.zip |
Merge remote-tracking branch 'joar/exif-rebase'
Diffstat (limited to 'extlib/leaflet/spec/suites/geometry/PointSpec.js')
-rw-r--r-- | extlib/leaflet/spec/suites/geometry/PointSpec.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/extlib/leaflet/spec/suites/geometry/PointSpec.js b/extlib/leaflet/spec/suites/geometry/PointSpec.js new file mode 100644 index 00000000..d004d60b --- /dev/null +++ b/extlib/leaflet/spec/suites/geometry/PointSpec.js @@ -0,0 +1,45 @@ +describe("Point", function() {
+
+ describe('constructor', function() {
+
+ it("should create a point with the given x and y", function() {
+ var p = new L.Point(1.5, 2.5);
+ expect(p.x).toEqual(1.5);
+ expect(p.y).toEqual(2.5);
+ });
+
+ it("should round the given x and y if the third argument is true", function() {
+ var p = new L.Point(1.3, 2.7, true);
+ expect(p.x).toEqual(1);
+ expect(p.y).toEqual(3);
+ });
+ });
+
+ describe('#subtract', function() {
+ it('should subtract the given point from this one', function() {
+ var a = new L.Point(50, 30),
+ b = new L.Point(20, 10);
+ expect(a.subtract(b)).toEqual(new L.Point(30, 20));
+ });
+ });
+
+ describe('#add', function() {
+ it('should add the given point to this one', function() {
+ expect(new L.Point(50, 30).add(new L.Point(20, 10))).toEqual(new L.Point(70, 40));
+ });
+ });
+
+ describe('#divideBy', function() {
+ it('should divide this point by the given amount', function() {
+ expect(new L.Point(50, 30).divideBy(5)).toEqual(new L.Point(10, 6));
+ });
+ });
+
+ describe('#multiplyBy', function() {
+ it('should multiply this point by the given amount', function() {
+ expect(new L.Point(50, 30).multiplyBy(2)).toEqual(new L.Point(100, 60));
+ });
+ });
+
+ describe('#distanceTo', noSpecs);
+});
\ No newline at end of file |