summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-25 08:59:10 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-25 08:59:10 +0100
commitf47a3968b7a78af8091906fe8936cd00581ae05f (patch)
treec357372927d0d84f31168dddede936d2bd148c43
parent0b592dd5c601d9225fdb6c395dc742e44e25504b (diff)
downloadgitbook-f47a3968b7a78af8091906fe8936cd00581ae05f.zip
gitbook-f47a3968b7a78af8091906fe8936cd00581ae05f.tar.gz
gitbook-f47a3968b7a78af8091906fe8936cd00581ae05f.tar.bz2
Add tests for multilingual book and json output
-rw-r--r--test/output-json.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/output-json.js b/test/output-json.js
index 6eb3c48..1006dab 100644
--- a/test/output-json.js
+++ b/test/output-json.js
@@ -18,5 +18,32 @@ describe('JSON Output', function() {
});
});
+
+ describe('Multilingual Book', function() {
+ var output;
+
+ before(function() {
+ return mock.outputBook(JSONOutput, {
+ 'LANGS.md': '# Languages\n\n'
+ + '* [en](./en)\n'
+ + '* [fr](./fr)\n\n',
+ 'en/README.md': '# Hello',
+ 'fr/README.md': '# Bonjour'
+
+ })
+ .then(function(_output) {
+ output = _output;
+ });
+ });
+
+ it('should correctly generate a README.json for each language', function() {
+ output.should.have.file('en/README.json');
+ output.should.have.file('fr/README.json');
+ });
+
+ it('should correctly generate a README.json for the whole book', function() {
+ output.should.have.file('README.json');
+ });
+ });
});