Add "languages" property to all json files for multilingual book

This commit is contained in:
Samy Pessé
2016-04-08 14:42:37 +02:00
parent 325c32b4c9
commit 4e41f96d89
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -240,7 +240,7 @@ Output.prototype.getContext = function() {
output: this.getSelfContext()
},
this.book.getContext(),
this.book.langs.getContext(),
(this.book.isLanguageBook()? this.book.parent: this.book).langs.getContext(),
this.book.summary.getContext(),
this.book.glossary.getContext(),
this.book.config.getContext(),
+15
View File
@@ -41,8 +41,23 @@ describe('JSON Output', function() {
output.should.have.file('fr/README.json');
});
it('should correctly add languages list to all json', function() {
var jsonFR = require(output.resolve('fr/README.json'));
var jsonEN = require(output.resolve('en/README.json'));
jsonFR.should.have.property('languages')
.with.property('list').with.lengthOf(2);
jsonEN.should.have.property('languages')
.with.property('list').with.lengthOf(2);
});
it('should correctly generate a README.json for the whole book', function() {
output.should.have.file('README.json');
var json = require(output.resolve('README.json'));
json.should.have.property('languages')
.with.property('list').with.lengthOf(2);
});
});
});