diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-24 18:18:43 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-24 18:18:43 +0100 |
commit | 572994a17e24b51624437e5b0f5da44a6156ffd7 (patch) | |
tree | 0e5bbfa3d4a7aa510f284a3df77741e51a75e1e4 /test/json.js | |
parent | 796dd4c13ac55e8b6232cbf38d49d9cf8c6676d2 (diff) | |
download | gitbook-572994a17e24b51624437e5b0f5da44a6156ffd7.zip gitbook-572994a17e24b51624437e5b0f5da44a6156ffd7.tar.gz gitbook-572994a17e24b51624437e5b0f5da44a6156ffd7.tar.bz2 |
Add more tests for inclusion
Diffstat (limited to 'test/json.js')
-rw-r--r-- | test/json.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/json.js b/test/json.js index 5852df7..b7cdefa 100644 --- a/test/json.js +++ b/test/json.js @@ -42,12 +42,18 @@ describe('JSON generator', function () { }, done); }); - it('should correctly generate a book with inclusion', function(done) { + it('should correctly generate a book with local inclusion', function(done) { testGeneration(books[5], "json", function(output) { - assert(fs.existsSync(path.join(output, "README.json"))); - var readme = JSON.parse(fs.readFileSync(path.join(output, "README.json"))); assert(readme.sections[0].content.indexOf('Hello World') > 0); }, done); }); + + it('should correctly generate a book with external inclusion', function(done) { + testGeneration(books[5], "json", function(output) { + var readme = JSON.parse(fs.readFileSync(path.join(output, "README.json"))); + assert(readme.sections[0].content.indexOf('Git1:Hello from git') > 0); + assert(readme.sections[0].content.indexOf('Git2:First Hello. Hello from git') > 0); + }, done); + }); }); |