aboutsummaryrefslogtreecommitdiffstats
path: root/extlib/leaflet/spec/suites/geometry/BoundsSpec.js
diff options
context:
space:
mode:
authorJoar Wandborg <git@wandborg.com>2012-01-28 18:47:01 +0100
committerJoar Wandborg <git@wandborg.com>2012-01-28 18:47:01 +0100
commit3d0d3bc97270095fae5f9a2508068631c46a5e61 (patch)
tree76778fcacaae35fc5662f276dab512a07bcee186 /extlib/leaflet/spec/suites/geometry/BoundsSpec.js
parentd7bec8577ea1b4d83df097f586324445fed1ef50 (diff)
parent9542a2ba076b7e00e79d7adb1a4e90a095427645 (diff)
downloadmediagoblin-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/BoundsSpec.js')
-rw-r--r--extlib/leaflet/spec/suites/geometry/BoundsSpec.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/extlib/leaflet/spec/suites/geometry/BoundsSpec.js b/extlib/leaflet/spec/suites/geometry/BoundsSpec.js
new file mode 100644
index 00000000..eee05e4b
--- /dev/null
+++ b/extlib/leaflet/spec/suites/geometry/BoundsSpec.js
@@ -0,0 +1,43 @@
+describe('Bounds', function() {
+ var a, b;
+
+ beforeEach(function() {
+ a = new L.Bounds(
+ new L.Point(14, 12),
+ new L.Point(30, 40));
+ b = new L.Bounds([
+ new L.Point(20, 12),
+ new L.Point(14, 20),
+ new L.Point(30, 40)
+ ]);
+ });
+
+ describe('constructor', function() {
+ it('should create bounds with proper min & max on (Point, Point)', function() {
+ expect(a.min).toEqual(new L.Point(14, 12));
+ expect(a.max).toEqual(new L.Point(30, 40));
+ });
+ it('should create bounds with proper min & max on (Point[])', function() {
+ expect(b.min).toEqual(new L.Point(14, 12));
+ expect(b.max).toEqual(new L.Point(30, 40));
+ });
+ });
+
+ describe('#extend', function() {
+ it('should extend the bounds to contain the given point', function() {
+ a.extend(new L.Point(50, 20));
+ expect(a.min).toEqual(new L.Point(14, 12));
+ expect(a.max).toEqual(new L.Point(50, 40));
+
+ b.extend(new L.Point(25, 50));
+ expect(b.min).toEqual(new L.Point(14, 12));
+ expect(b.max).toEqual(new L.Point(30, 50));
+ });
+ });
+
+ describe('#getCenter', function() {
+ it('should return the center point', function() {
+ expect(a.getCenter()).toEqual(new L.Point(22, 26));
+ });
+ });
+}); \ No newline at end of file