mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-18 08:35:10 +00:00
29 lines
801 B
JavaScript
29 lines
801 B
JavaScript
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/configuration/json'));
|
|
book.config.load()
|
|
.then(function() {
|
|
assert(book.options.title == "Test");
|
|
})
|
|
.then(function() {
|
|
done()
|
|
}, done);
|
|
});
|
|
|
|
it('should correctly load from javascript', function(done) {
|
|
var book = new Book(path.join(__dirname, './fixtures/configuration/js'));
|
|
book.config.load()
|
|
.then(function() {
|
|
assert(book.options.title == "Test 2");
|
|
})
|
|
.then(function() {
|
|
done()
|
|
}, done);
|
|
});
|
|
});
|