Files
gitbook/test
2016-03-15 12:37:25 +01:00
..
2016-02-29 09:14:43 +01:00
2016-02-28 14:47:34 +01:00
2016-02-29 09:14:43 +01:00
2016-02-18 16:34:11 +01:00
2016-03-07 10:40:25 +01:00
2016-02-29 17:35:12 +01:00
2016-03-07 10:40:25 +01:00
2016-02-24 13:35:59 +01:00
2016-02-18 16:34:11 +01:00

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

describe('Readme', function() {
    it('should parse empty readme', function() {
        return mock.setupDefaultBook({
            'README.md': ''
        })
        .then(function(book) {
            return book.prepareConfig()

            .then(function() {
                return book.readme.load();
            });
        });
    });

    it('should parse readme', function() {
        return mock.setupDefaultBook({
            'README.md': '# Hello World\nThis is my book'
        })
        .then(function(book) {
            return book.readme.load()
            .then(function() {
                book.readme.title.should.equal('Hello World');
                book.readme.description.should.equal('This is my book');
            });
        });
    });

    it('should parse AsciiDoc readme', function() {
        return mock.setupBook({
            'README.adoc': '# Hello World\n\nThis is my book\n'
        })
        .then(function(book) {
            return book.readme.load()
            .then(function() {
                book.readme.title.should.equal('Hello World');
                book.readme.description.should.equal('This is my book');
            });
        });
    });
});