Skip to content

Commit

Permalink
fixes #78 : Add UnitTests for modules
Browse files Browse the repository at this point in the history
Adding unit tests for settings module
  • Loading branch information
remie committed Sep 16, 2015
1 parent 2df3caf commit fa31372
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/modules/settings.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

var should = require('chai').should();
var settings = require('../../lib/settings.js')({
path: './test/modules/settings.json'
});

describe('YouTransfer Settings module', function() {
var title = "My Awesome Title";

it('should be possible to set options', function() {
settings.options.path.should.equal('./test/modules/settings.json');
});

it('should be possible to set title', function() {
settings.push({ title: title }, function(err) {
should.not.exist(err);
});
});

it('should be possible to get title', function() {
settings.get(function(err, output) {
should.not.exist(err);
output.title.should.equal(title);
});
});
});

0 comments on commit fa31372

Please sign in to comment.