(function () { 'use strict'; var ID = 'boot'; var DEPS = ['$', 'core/server']; describe('module \'' + ID + '\'', function () { before(function () { this.definition = modulejs._private.definitions[ID]; this.xConfig = util.uniqObj(); this.xDefine = sinon.stub(modulejs, 'define'); this.xRequire = sinon.stub(modulejs, 'require'); this.xServer = { request: sinon.stub().callsArgWith(1, this.xConfig) }; this.applyFn = function () { this.xDefine.reset(); this.xRequire.reset(); this.xServer.request.reset(); return this.definition.fn($, this.xServer); }; }); after(function () { this.xDefine.restore(); this.xRequire.restore(); util.restoreHtml(); }); beforeEach(function () { util.restoreHtml(); }); describe('definition', function () { it('is defined', function () { assert.isPlainObject(this.definition); }); it('has correct id', function () { assert.strictEqual(this.definition.id, ID); }); it('requires correct', function () { assert.deepEqual(this.definition.deps, DEPS); }); it('args for each request', function () { assert.strictEqual(this.definition.deps.length, this.definition.fn.length); }); it('has no instance', function () { assert.notProperty(modulejs._private.instances, ID); }); it('inits without errors', function () { this.applyFn(); }); }); describe('application', function () { it('returns undefined', function () { var instance = this.applyFn(); assert.isUndefined(instance); }); it('no data-module', function () { this.applyFn(); assert.isFalse(this.xServer.request.called); assert.isFalse(this.xDefine.called); assert.isFalse(this.xRequire.called); }); it('data-module=\'test\'', function () { $('