diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-03-24 23:14:17 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-03-24 23:14:17 +0100 |
commit | c9af209a9335ea1219c3149eb12c2daa271c9403 (patch) | |
tree | 72df3edf7a67db465ce2dacbbf204974253b818a /test/languages.js | |
parent | 63ee94ff89d10e56d82079183c494f8129b92eae (diff) | |
parent | 48ab44a776b665b1d3627192cf82e9220ec74678 (diff) | |
download | gitbook-c9af209a9335ea1219c3149eb12c2daa271c9403.zip gitbook-c9af209a9335ea1219c3149eb12c2daa271c9403.tar.gz gitbook-c9af209a9335ea1219c3149eb12c2daa271c9403.tar.bz2 |
Merge pull request #667 from GitbookIO/better-testing
Better Unit Tests
Diffstat (limited to 'test/languages.js')
-rw-r--r-- | test/languages.js | 40 |
1 files changed, 40 insertions, 0 deletions
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"); + }); + }); +}); |