diff options
-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; }); |