Clean code.

This commit is contained in:
Lars Jung 2015-04-22 19:34:35 +02:00
parent c396800dfa
commit 882bf8ae11
17 changed files with 202 additions and 148 deletions

View file

@ -16,7 +16,7 @@ describe('module "' + ID + '"', function () {
b: 'myTheme/b.jpg'
}
};
this.xSettings = {appHref: '/some/app/href/'};
this.xSettings = {appHref: util.uniqPath('/appHref/')};
this.applyFn = function () {
return this.definition.fn(_, this.xConfig, this.xSettings);
@ -66,21 +66,15 @@ describe('module "' + ID + '"', function () {
});
});
describe('publics', function () {
describe('.image()', function () {
it('.image() is function', function () {
it('is function', function () {
var instance = this.applyFn();
assert.isFunction(instance.image);
});
it('.icon() is function', function () {
var instance = this.applyFn();
assert.isFunction(instance.icon);
});
it('.image() works', function () {
it('works', function () {
var instance = this.applyFn();
var ui = this.xSettings.appHref + 'client/images/ui/';
@ -90,8 +84,17 @@ describe('module "' + ID + '"', function () {
assert.strictEqual(instance.image(''), ui + '.svg');
assert.strictEqual(instance.image('a'), ui + 'a.svg');
});
});
it('.icon() works', function () {
describe('.icon()', function () {
it('is function', function () {
var instance = this.applyFn();
assert.isFunction(instance.icon);
});
it('works', function () {
var instance = this.applyFn();
var themes = this.xSettings.appHref + 'client/images/themes/';