summaryrefslogtreecommitdiffstats
path: root/test/readme.js
blob: 811591c844c53debdbe8d837406a215cab31ffac (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
var fs = require('fs');
var path = require('path');
var assert = require('assert');

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


var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/README.md'), 'utf8');
var LEXED = readme(CONTENT);

describe('Readme parsing', function () {

    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.");
    });
});