Files
gitbook/test
2016-02-18 10:53:57 +01:00
..
2016-02-17 21:02:42 +01:00
2016-02-11 22:12:07 +01:00
2016-01-28 23:23:56 +01:00
2016-02-11 17:10:59 +01:00
2016-01-28 23:23:56 +01:00
2016-01-28 23:23:56 +01:00
2016-02-17 21:02:42 +01:00
2016-02-17 21:03:00 +01:00
2016-02-17 21:25:08 +01:00
2016-01-28 23:23:56 +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');
            });
        });
    });
});