summaryrefslogtreecommitdiffstats
path: root/test/languages.js
blob: 0bde347cb247227fda15c76ab75b855869e27146 (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("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");
        });
    });
});