summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-asciidoc/test/readme.js
blob: 2f4f6015c1b0dbf1f2b0ad21c23cc40599ecd4a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var fs = require('fs');
var path = require('path');
var assert = require('assert');

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

describe('Readme parsing', function () {
    var LEXED;

    before(function() {
        var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/README.adoc'), 'utf8');
        LEXED = readme(CONTENT);
    });

    it('should contain a title', function() {
        assert(LEXED.title);
    });

    it('should contain a description', function() {
        assert(LEXED.description);
    });

    it('should extract the right title', function() {
        assert.equal(LEXED.title, "This is the title");
    });

    it('should extract the right description', function() {
        assert.equal(LEXED.description, "This is the book description.");
    });
});