summaryrefslogtreecommitdiffstats
path: root/test/configuration.js
blob: d30fd61e7069eb131b309401e425ce3116bf61ae (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
29
30
31
32
33
34
35
36
37
describe('Configuration', function () {
    it('should extract default title from README', function() {
        return books.parse('basic')
            .then(function(book) {
                book.options.title.should.be.equal('Readme');
            });
    });

    it('should extract default description from README', function() {
        return books.parse('basic')
            .then(function(book) {
                book.options.description.should.be.equal('Default description for the book.');
            });
    });

    it('should correctly load from json (book.json)', function() {
        return books.parse('config-json')
            .then(function(book) {
                book.options.title.should.be.equal('json-config');
            });
    });

    it('should correctly load from JavaScript (book.js)', function() {
        return books.parse('config-js')
            .then(function(book) {
                book.options.title.should.be.equal('js-config');
            });
    });

    it('should provide configuration on book.config.get', function() {
        return books.parse('basic')
            .then(function(book) {
                book.config.get('description').should.be.equal('Default description for the book.');
                book.getConfig('description').should.be.equal('Default description for the book.');
            });
    });
});