Comparing version 0.9.1 to 0.9.2
@@ -708,3 +708,3 @@ 'use strict'; | ||
}, function set(value) { | ||
if (value instanceof Pagelet) return this._bootstrap = value; | ||
if (value && value.name === 'bootstrap') return this._bootstrap = value; | ||
}); | ||
@@ -711,0 +711,0 @@ |
{ | ||
"name": "pagelet", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "pagelet", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -279,3 +279,3 @@ describe('Pagelet', function () { | ||
it('sets a reference to a bootstrap pagelet', function () { | ||
var bootstrap = new Pagelet; | ||
var bootstrap = new (Pagelet.extend({ name: 'bootstrap' })); | ||
@@ -286,5 +286,8 @@ pagelet.bootstrap = bootstrap; | ||
it('only accepts pagelet instances', function () { | ||
it('only accepts objects that look like bootstrap pagelets', function () { | ||
pagelet.bootstrap = 'will not be set'; | ||
assume(pagelet._bootstrap).to.equal(void 0); | ||
pagelet.bootstrap = { name: 'bootstrap', test: 'will be set' }; | ||
assume(pagelet._bootstrap).to.have.property('test', 'will be set'); | ||
}); | ||
@@ -296,3 +299,3 @@ | ||
var bootstrap = new Pagelet({ name: 'bootstrap' }); | ||
var bootstrap = new (Pagelet.extend({ name: 'bootstrap' })); | ||
@@ -299,0 +302,0 @@ pagelet.bootstrap = bootstrap; |
73463
1560