diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-01-28 23:23:56 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-01-28 23:23:56 +0100 |
commit | ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62 (patch) | |
tree | 31ca85c3d2d93935eb6c351bd9e5ca317fc0e2a3 /test/config.js | |
parent | ea98444dc0a6e59e79408963e1d340d7765ba9f6 (diff) | |
download | gitbook-ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62.zip gitbook-ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62.tar.gz gitbook-ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62.tar.bz2 |
Add order for tests
Diffstat (limited to 'test/config.js')
-rw-r--r-- | test/config.js | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/test/config.js b/test/config.js new file mode 100644 index 0000000..3ec76ca --- /dev/null +++ b/test/config.js @@ -0,0 +1,57 @@ +var mock = require('./mock'); + +describe('Config', function() { + + describe('No configuration', function() { + var book; + + before(function() { + return mock.setupDefaultBook() + .then(function(_book) { + book = _book; + return book.prepareConfig(); + }); + }); + + it('should signal that configuration is not defined', function() { + book.config.exists().should.not.be.ok(); + }); + }); + + describe('JSON file', function() { + var book; + + before(function() { + return mock.setupDefaultBook({ + 'book.json': { title: 'Hello World' } + }) + .then(function(_book) { + book = _book; + return book.prepareConfig(); + }); + }); + + it('should correctly extend configuration', function() { + book.config.get('title', '').should.equal('Hello World'); + }); + }); + + describe('JS file', function() { + var book; + + before(function() { + return mock.setupDefaultBook({ + 'book.js': 'module.exports = { title: "Hello World" };' + }) + .then(function(_book) { + book = _book; + return book.prepareConfig(); + }); + }); + + it('should correctly extend configuration', function() { + book.config.get('title', '').should.equal('Hello World'); + }); + }); +}); + |