(function() {

    'use strict';

    const assert = require('assert');
    const Coord = require('../src/core/Coord');
    const Layer = require('../src/layer/Layer');
    const TilePyramid = require('../src/layer/TilePyramid');

    let layer;

    describe('TilePyramid', () => {

        before(() => {
            layer = new Layer();
            layer.requestTile = (coord, done) => {
                done(null, {});
            };
        });

        after(() => {
            layer = null;
        });

        describe('#constructor()', () => {
            it('should accept a `layer` argument', () => {
                new TilePyramid(layer);
            });
            it('should throw an error if there is no `layer` argument', () => {
                let err = false;
                try {
                    new TilePyramid();
                } catch(e) {
                    err = true;
                }
                assert(err);
            });
        });

        describe('#get()', () => {
            it('should get an active tile from the pyramid', () => {
                const pyramid = new TilePyramid(layer);
                const coord = new Coord(0, 0, 0);
                pyramid.requestTiles([coord]);
                assert(pyramid.get(coord) !== undefined);
            });
            it('should return `undefined` if the pyramid does not contain the tile', () => {
                const pyramid = new TilePyramid(layer);
                const coord = new Coord(0, 0, 0);
                assert(pyramid.get(coord) === undefined);
            });
        });

    });

}());

@@ -222,16 +222,70 @@
 ramid');
+%0A    const Viewport = require('../src/plot/Viewport');
 %0A%0A    le
@@ -292,16 +292,30 @@
 t layer;
+%0A    let plot;
 %0A%0A    de
@@ -499,16 +499,290 @@
      %7D;%0A
+            plot = %7B%0A                zoom: 0,%0A                tileSize: 256,%0A                viewport: new Viewport(%7B%0A                    x: -256,%0A                    y: -256,%0A                    width: 512,%0A                    height: 512%0A                %7D)%0A            %7D;%0A
         
@@ -834,16 +834,41 @@
 = null;%0A
+            plot = null;%0A
         
@@ -1592,14 +1592,22 @@
 les(
-%5B
+plot, %5B 
 coord
+ 
 %5D);%0A

Update failing TilePyramid test.