Skip to content

Commit

Permalink
Implement tests for normalize-model task module
Browse files Browse the repository at this point in the history
  • Loading branch information
tormozz48 committed Jan 16, 2016
1 parent e5b18ff commit 45ae595
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require('./src/tasks-libraries/model/version.test.js');
require('./src/tasks-docs/github/index.test.js');

require('./src/tasks-core/merge-models.test.js');
require('./src/tasks-core/normalize-model.test.js');
// require('./src/tasks-core/rsync-cache-data.test.js');

// require('./src/tasks-docs/load-from-github.test.js');
Expand Down
22 changes: 22 additions & 0 deletions test/src/tasks-core/normalize-model.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var Model = require('../../../lib/model'),
normalizeModel = require('../../../lib/tasks-core/normalize-model');

describe('tasks-core/normalize-model', function() {
var sandbox = sinon.sandbox.create(),
model = new Model();

it('should return function as result', function() {
normalizeModel(model).should.be.instanceOf(Function);
});

it('should call model normalization function', function() {
sandbox.stub(model, 'normalize').returns(model);
return normalizeModel(model)().then(function() {
model.normalize.should.be.called;
});
});

it('should return promise with model instance', function() {
return normalizeModel(model)().should.eventually.instanceOf(Model);
});
});

0 comments on commit 45ae595

Please sign in to comment.