Disallow adding the same feature twice

This commit is contained in:
Tim Schaub
2014-05-20 10:05:47 -06:00
parent 652f11cefa
commit a2b81d6bd0
2 changed files with 21 additions and 3 deletions

View File

@@ -363,6 +363,21 @@ describe('ol.source.Vector', function() {
});
describe('the undefined feature id index', function() {
var source;
beforeEach(function() {
source = new ol.source.Vector();
});
it('disallows adding the same feature twice', function() {
var feature = new ol.Feature();
source.addFeature(feature);
expect(function() {
source.addFeature(feature);
}).to.throwException();
});
});
});