@@ -0,0 +1,2677 @@
+// Load modules%0A%0Avar Lab = require('lab');%0Avar Code = require('code');%0Avar Hodgepodge = require('..');%0A%0A// Test shortcuts%0A%0Avar lab = exports.lab = Lab.script();%0Avar describe = lab.describe;%0Avar it = lab.it;%0Avar expect = Code.expect;%0A%0A%0Adescribe('Hodgepodge', function () %7B%0A%0A    // Plugin A%0A%0A    var pluginA = function () %7B%7D;%0A    pluginA.attributes = %7B%0A        name: 'plugin-a',%0A        dependencies: %5B'plugin-b', 'plugin-c'%5D%0A    %7D;%0A%0A%0A    // Plugin B%0A%0A    var pluginB = function () %7B%7D;%0A    pluginB.attributes = %7B%0A        name: 'plugin-b',%0A        hodgepodge: true,%0A        dependencies: 'plugin-c'%0A    %7D;%0A%0A    pluginB.restore = function () %7B%0A%0A        this.attributes.hodgepodge = true;%0A    %7D;%0A%0A%0A    // Plugin C%0A%0A    var pluginC = function () %7B%7D;%0A%0A    pluginC.attributes = %7B%0A        name: 'plugin-c'%0A    %7D;%0A%0A%0A    // Finally the tests%0A%0A    it('consumes falsey values.', function (done) %7B%0A%0A        expect(Hodgepodge(false)).to.deep.equal(%5B%5D);%0A        expect(Hodgepodge(null)).to.deep.equal(%5B%5D);%0A        expect(Hodgepodge(undefined)).to.deep.equal(%5B%5D);%0A        done();%0A    %7D);%0A%0A    it('consumes a plain plugin.', function (done) %7B%0A%0A        expect(Hodgepodge(pluginA)).to.deep.equal(%5BpluginA%5D);%0A        done();%0A    %7D);%0A%0A    it('consumes unfamiliar objects.', function (done) %7B%0A%0A        var ufos = %5B%0A            1,%0A            'two',%0A            %7B three: 3 %7D%0A        %5D;%0A%0A        var degenerates = %5B%0A            function () %7B%7D%0A        %5D;%0A%0A        expect(Hodgepodge(ufos)).to.deep.equal(ufos);%0A        expect(Hodgepodge(degenerates)).to.deep.equal(degenerates);%0A        expect(Hodgepodge(1)).to.deep.equal(%5B1%5D);%0A        done();%0A    %7D);%0A%0A    it('consumes a list of plugins using the function format.', function (done) %7B%0A%0A        expect(Hodgepodge(%5BpluginA%5D)).to.deep.equal(%5BpluginA%5D);%0A        done();%0A    %7D);%0A%0A    it('consumes a list of plugins using the object format.', function (done) %7B%0A%0A        var plugins = %5B%0A            %7B%0A                register: pluginA,%0A                options: %7B%7D%0A            %7D%0A        %5D;%0A%0A        expect(Hodgepodge(plugins)).to.deep.equal(plugins);%0A        done();%0A    %7D);%0A%0A    it('reorders a list of plugins, respecting their dependencies.', function (done) %7B%0A%0A        var plugins = %5BpluginA, pluginB, pluginC%5D;%0A%0A        expect(Hodgepodge(plugins)).to.deep.equal(%5BpluginC, pluginB, pluginA%5D);%0A        done();%0A    %7D);%0A%0A    it('eats-up the hodgepodge attribute.', function (done) %7B%0A%0A        expect(pluginB.attributes.hodgepodge).to.equal(true);%0A%0A        var plugins = Hodgepodge(%5BpluginB%5D);%0A%0A        expect(plugins%5B0%5D).to.equal(pluginB);%0A        expect(plugins%5B0%5D.attributes.hodgepodge).to.not.exist();%0A%0A        pluginB.restore();%0A        done();%0A    %7D);%0A%0A%7D);%0A

Add tests.