diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-03-24 13:24:20 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-03-24 13:24:20 +0100 |
commit | 346c05f0de8a06ba07e7644f80aa6b3a7b8254a6 (patch) | |
tree | 9c42920068a14ab7ff0e24d1a57f4810561095ae /test/configuration.js | |
parent | 73c69923b34b30105750d1e72990d5a9b0ca1596 (diff) | |
download | gitbook-346c05f0de8a06ba07e7644f80aa6b3a7b8254a6.zip gitbook-346c05f0de8a06ba07e7644f80aa6b3a7b8254a6.tar.gz gitbook-346c05f0de8a06ba07e7644f80aa6b3a7b8254a6.tar.bz2 |
Add tests for configuration parsing
Diffstat (limited to 'test/configuration.js')
-rw-r--r-- | test/configuration.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/configuration.js b/test/configuration.js new file mode 100644 index 0000000..f1fb223 --- /dev/null +++ b/test/configuration.js @@ -0,0 +1,25 @@ +var fs = require('fs'); +var path = require('path'); + +describe('Configuration', function () { + it('should extract default title from README', function() { + return books.parse("basic") + .then(function(book) { + book.options.title.should.be.equal("Readme"); + }); + }); + + it('should correctly load from json (book.json)', function() { + return books.parse("config-json") + .then(function(book) { + book.options.title.should.be.equal("json-config"); + }); + }); + + it('should correctly load from JavaScript (book.js)', function() { + return books.parse("config-js") + .then(function(book) { + book.options.title.should.be.equal("js-config"); + }); + }); +}); |