Skip to content
Mickael Daniel edited this page Jan 16, 2013 · 1 revision

test-namespaces

Alias and namespaces

env.namespace().

var env = generators();
assert.equal(env.namespace('backbone/all/index.js'), 'backbone:all');
assert.equal(env.namespace('backbone/all/main.js'), 'backbone:all');
assert.equal(env.namespace('backbone/all'), 'backbone:all');
assert.equal(env.namespace('backbone/all.js'), 'backbone:all');
assert.equal(env.namespace('backbone.js'), 'backbone');

assert.equal(env.namespace('generator-backbone/all.js'), 'backbone:all');
assert.equal(env.namespace('generator-mocha/backbone/model/index.js'), 'mocha:backbone:model');
assert.equal(env.namespace('generator-mocha/backbone/model.js'), 'mocha:backbone:model');
assert.equal(env.namespace('node_modules/generator-mocha/backbone/model.js'), 'mocha:backbone:model');

assert.equal(env.namespace('../local/stuff'), 'local:stuff');
assert.equal(env.namespace('./local/stuff'), 'local:stuff');
assert.equal(env.namespace('././local/stuff'), 'local:stuff');
assert.equal(env.namespace('../../local/stuff'), 'local:stuff');
Clone this wiki locally