Files
gitbook/test
2016-02-22 23:52:38 +01:00
..
2016-02-22 15:46:53 +01:00
2016-01-28 23:23:56 +01:00
2016-02-18 16:34:11 +01:00
2016-01-28 23:23:56 +01:00
2016-02-18 14:47:53 +01:00
2016-02-18 19:19:09 +01:00
2016-02-21 18:43:37 +01:00
2016-02-18 16:34:11 +01:00
2016-02-22 15:39:36 +01:00
2016-01-28 23:23:56 +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');
            });
        });
    });
});