summaryrefslogtreecommitdiffstats
path: root/test/json.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/json.js')
-rw-r--r--test/json.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/json.js b/test/json.js
index e86ee4e..56483c6 100644
--- a/test/json.js
+++ b/test/json.js
@@ -49,4 +49,40 @@ describe('JSON generator', function () {
});
});
});
+
+ describe('Multilingual Book', function() {
+ var book;
+
+ before(function() {
+ return books.generate("languages", "json")
+ .then(function(_book) {
+ book = _book;
+ });
+ });
+
+ it('should correctly output a README.json', function() {
+ book.should.have.file("README.json");
+ });
+
+ it('should output a valid json', function() {
+ book.should.have.jsonfile("README.json");
+ });
+
+ describe('Page Format', function() {
+ var page;
+
+ before(function() {
+ page = JSON.parse(
+ fs.readFileSync(
+ path.join(book.options.output, "README.json"),
+ { encoding: "utf-8" }
+ )
+ );
+ });
+
+ it('should contains no languages', function() {
+ page.should.have.property("langs").with.lengthOf(2);
+ });
+ });
+ });
});