diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-03-24 14:16:03 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-03-24 14:16:03 +0100 |
commit | 4b7797f61b969b6d7bd3b5cfe1f9ff0f22b57ae7 (patch) | |
tree | 4117bee3fa1553466bf14f4b3956bb4d31d167e2 /test | |
parent | f775d41933efb3dbe47339f069097752667ee5b8 (diff) | |
download | gitbook-4b7797f61b969b6d7bd3b5cfe1f9ff0f22b57ae7.zip gitbook-4b7797f61b969b6d7bd3b5cfe1f9ff0f22b57ae7.tar.gz gitbook-4b7797f61b969b6d7bd3b5cfe1f9ff0f22b57ae7.tar.bz2 |
Add basic tests for multilingual books
Diffstat (limited to 'test')
-rw-r--r-- | test/glossary.js | 2 | ||||
-rw-r--r-- | test/languages.js | 40 | ||||
-rw-r--r-- | test/summary.js | 2 |
3 files changed, 42 insertions, 2 deletions
diff --git a/test/glossary.js b/test/glossary.js index acfd184..631967e 100644 --- a/test/glossary.js +++ b/test/glossary.js @@ -6,7 +6,7 @@ describe('Glossary', function () { var book; before(function() { - return books.parse("glossary", "website") + return books.parse("glossary") .then(function(_book) { book = _book; }); diff --git a/test/languages.js b/test/languages.js new file mode 100644 index 0000000..abdc5dd --- /dev/null +++ b/test/languages.js @@ -0,0 +1,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"); + }); + }); +}); diff --git a/test/summary.js b/test/summary.js index 3837651..99cdf6b 100644 --- a/test/summary.js +++ b/test/summary.js @@ -6,7 +6,7 @@ describe('Summary', function () { var book; before(function() { - return books.parse("summary", "website") + return books.parse("summary") .then(function(_book) { book = _book; }); |