diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/configuration.js | 17 | ||||
-rw-r--r-- | test/fixtures/config/book.json | 3 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/configuration.js b/test/configuration.js new file mode 100644 index 0000000..6540d34 --- /dev/null +++ b/test/configuration.js @@ -0,0 +1,17 @@ +var path = require('path'); +var assert = require('assert'); + +var Book = require('../').Book; + +describe('Configuration parsing', function () { + it('should correctly load from json', function(done) { + var book = new Book(path.join(__dirname, './fixtures/config')); + book.config.load() + .then(function() { + assert(book.options.title == "Test"); + }) + .then(function() { + done() + }, done); + }); +}); diff --git a/test/fixtures/config/book.json b/test/fixtures/config/book.json new file mode 100644 index 0000000..a2191b8 --- /dev/null +++ b/test/fixtures/config/book.json @@ -0,0 +1,3 @@ +{ + "title": "Test" +}
\ No newline at end of file |