summaryrefslogtreecommitdiffstats
path: root/test/languages.js
blob: abdc5dd292d0f21c00f66a0a7eb42fea2e937bfb (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
38
39
40
var fs = require('fs');
var path = require('path');

describe('Languages', function () {
    describe('Parsing', function() {
        var book;

        before(function() {
            return books.parse("languages")
                .then(function(_book) {
                    book = _book;
                });
        });

        it('should correctly list languages', function() {
            book.should.have.property("books");
            book.books.should.have.lengthOf(2);

            book.books[0].options.language.should.be.equal("en");
            book.books[1].options.language.should.be.equal("fr");
        });
    });

    describe('Generation', function() {
        var book;

        before(function() {
            return books.generate("languages", "website")
                .then(function(_book) {
                    book = _book;
                });
        });

        it('should correctly create books', function() {
            book.should.have.file("index.html");
            book.should.have.file("en/index.html");
            book.should.have.file("fr/index.html");
        });
    });
});