anchor.diff:          var layer = { onAdd: sinon.spy() };
           map.addLayer(layer);
           expect(layer.onAdd.called).not.to.be.ok();
  -        map.setView([0, 0], 0);
  +        map.setView(new LatLng(0, 0), 0);
           expect(layer.onAdd.called).to.be.ok();
         });
   
  
positive.code:         });
        });
  
        test('when the map has already been loaded', () {
          test('calls the callback immediately', () {
            map.setView(new LatLng(0, 0), 1);
            map.whenReady(() {
  
negative.code:       test('fires a layeradd event when the map becomes ready', () {
          var layer = { onAdd: sinon.spy() },
              spy = sinon.spy();
          map.on(EventType.LAYERADD, spy);
          map.addLayer(layer);
          expect(spy.called).not.to.be.ok();
          map.setView(new LatLng(0, 0), 0);
          expect(spy.called).to.be.ok();
        });
  
        test('does not fire a layeradd event if the layer is removed before the map becomes ready', () {
          var layer = { onAdd: sinon.spy(), onRemove: sinon.spy() },
              spy = sinon.spy();
          map.on(EventType.LAYERADD, spy);
          map.addLayer(layer);
          map.removeLayer(layer);
          map.setView(new LatLng(0, 0), 0);
          expect(spy.called).not.to.be.ok();
        });
  
        test('adds the layer before firing layeradd', (/*done*/) {
          var layer = { onAdd: sinon.spy(), onRemove: sinon.spy() };
          map.on(EventType.LAYERADD, (Object obj, Event e) {
            expect(map.hasLayer(layer), isTrue);
            done();
          });
          map.setView(new LatLng(0, 0), 0);
          map.addLayer(layer);
        });
  
        group('When the first layer is added to a map', () {
          test('fires a zoomlevelschange event', () {
            var spy = sinon.spy();
            map.on(EventType.ZOOMLEVELSCHANGE, spy);
            expect(spy.called).not.to.be.ok();
            new TileLayer('{z}{x}{y}', {'minZoom': 0, 'maxZoom': 10}).addTo(map);
            expect(spy.called).to.be.ok();
          });
        });
  
        group('when a new layer with greater zoomlevel coverage than the current layer is added to a map', () {
          test('fires a zoomlevelschange event', () {
            var spy = sinon.spy();
            new TileLayer('{z}{x}{y}', {minZoom: 0, maxZoom: 10}).addTo(map);
            map.on(EventType.ZOOMLEVELSCHANGE, spy);
            expect(spy.called).not.to.be.ok();
            new TileLayer('{z}{x}{y}', {minZoom: 0, maxZoom: 15}).addTo(map);
            expect(spy.called).to.be.ok();
          });
        });
  
        group('when a new layer with the same or lower zoomlevel coverage as the current layer is added to a map', () {
          test('fires no zoomlevelschange event', () {
            var spy = sinon.spy();
            new TileLayer('{z}{x}{y}', {minZoom: 0, maxZoom: 10}).addTo(map);
            map.on(EventType.ZOOMLEVELSCHANGE, spy);
            expect(spy.called).not.to.be.ok();
            new TileLayer('{z}{x}{y}', {minZoom: 0, maxZoom: 10}).addTo(map);
            expect(spy.called).not.to.be.ok();
            new TileLayer('{z}{x}{y}', {minZoom: 0, maxZoom: 5}).addTo(map);
            expect(spy.called).not.to.be.ok();
          });
        });
      });
  
      group('#removeLayer', () {
        test('calls layer.onRemove if the map is ready', () {
          final layer = { onAdd: sinon.spy(), onRemove: sinon.spy() };
          map.setView(new LatLng(0, 0), 0);
          map.addLayer(layer);
          map.removeLayer(layer);
          expect(layer.onRemove.called).to.be.ok();
  