diff --git a/index.html b/index.html index 9c3ef5e63d..b33764958a 100644 --- a/index.html +++ b/index.html @@ -26,8 +26,12 @@ + diff --git a/main.js b/main.js index a51e29965a..ab911921ec 100644 --- a/main.js +++ b/main.js @@ -89,5 +89,11 @@ define([ './example/generator/bundle' ], function (Main, legacyRegistry) { 'use strict'; - new Main().run(legacyRegistry); + + return { + legacyRegistry: legacyRegistry, + run: function () { + return new Main().run(legacyRegistry); + } + }; }); \ No newline at end of file diff --git a/src/BundleRegistry.js b/src/BundleRegistry.js index ae4f45ba27..a65a9b8f3c 100644 --- a/src/BundleRegistry.js +++ b/src/BundleRegistry.js @@ -44,5 +44,9 @@ define(function () { return Object.keys(this.bundles); }; + BundleRegistry.prototype.remove = function (path) { + delete this.bundles[path]; + }; + return BundleRegistry; }); \ No newline at end of file diff --git a/src/BundleRegistrySpec.js b/src/BundleRegistrySpec.js index d005209a42..04a48d440a 100644 --- a/src/BundleRegistrySpec.js +++ b/src/BundleRegistrySpec.js @@ -68,6 +68,21 @@ define(['./BundleRegistry'], function (BundleRegistry) { expect(bundleRegistry.get(testPath)) .toBe(testBundleDef); }); + + describe("and then removed", function () { + beforeEach(function () { + bundleRegistry.remove(testPath); + }); + + it("appears empty again", function () { + expect(bundleRegistry.list()).toEqual([]); + }); + + it("does not contain the removed bundle", function () { + expect(bundleRegistry.contains(testPath)) + .toBe(false); + }); + }); }); });