summaryrefslogtreecommitdiffstats
path: root/test/summary.js
blob: a90212fae914ee9f5dd4ac0219b7cb198f3bef50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var path = require('path');
var assert = require('assert');

var Book = require('../').Book;

describe('Summary parsing', function () {
    it('should correctly parse it from markdown', function(done) {
        var book = new Book(path.join(__dirname, './fixtures/summary/markdown'));
        book.parseSummary()
        .then(function() {
            var LEXED = book.summary;

        	assert.equal(LEXED.chapters[0].path,'README.md');
            assert.equal(LEXED.chapters[1].path,'chapter-1/README.md');
            assert.equal(LEXED.chapters[2].path,'chapter-2/README.md');
            assert.equal(LEXED.chapters[3].path,'chapter-3/README.md');
        })
        .then(function() {
        	done()
        }, done);
    });
});