Files
gitbook/test
Aaron O'Mullan 3f36d83bfb Add test/bin/lex.js utility
Helpful binary when developing / debugging
2015-01-14 21:56:57 +01:00
..
2015-01-14 21:56:57 +01:00
2015-01-14 21:45:32 +01:00
2014-05-05 15:25:15 +02:00
2014-11-03 17:40:38 +01:00
2015-01-14 21:45:32 +01:00

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