diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-24 15:33:04 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-24 15:33:04 +0100 |
commit | e02f29e76392660b31be87063649abd4adb22826 (patch) | |
tree | dfda77c00534b64701784f32daf21af08a0639b7 | |
parent | 6805b02c63c95e297bf69ce68800e021e744c052 (diff) | |
download | gitbook-e02f29e76392660b31be87063649abd4adb22826.zip gitbook-e02f29e76392660b31be87063649abd4adb22826.tar.gz gitbook-e02f29e76392660b31be87063649abd4adb22826.tar.bz2 |
Add test for local inclusion
-rw-r--r-- | test/fixtures/test5/README.md | 3 | ||||
-rw-r--r-- | test/fixtures/test5/SUMMARY.md | 1 | ||||
-rw-r--r-- | test/fixtures/test5/test.md | 1 | ||||
-rw-r--r-- | test/json.js | 9 |
4 files changed, 14 insertions, 0 deletions
diff --git a/test/fixtures/test5/README.md b/test/fixtures/test5/README.md new file mode 100644 index 0000000..67536b3 --- /dev/null +++ b/test/fixtures/test5/README.md @@ -0,0 +1,3 @@ +# Test Content inclusion + +{% include "./test.md" %} diff --git a/test/fixtures/test5/SUMMARY.md b/test/fixtures/test5/SUMMARY.md new file mode 100644 index 0000000..ac9323c --- /dev/null +++ b/test/fixtures/test5/SUMMARY.md @@ -0,0 +1 @@ +# Summary diff --git a/test/fixtures/test5/test.md b/test/fixtures/test5/test.md new file mode 100644 index 0000000..5e1c309 --- /dev/null +++ b/test/fixtures/test5/test.md @@ -0,0 +1 @@ +Hello World
\ No newline at end of file diff --git a/test/json.js b/test/json.js index 1620d00..5852df7 100644 --- a/test/json.js +++ b/test/json.js @@ -41,4 +41,13 @@ describe('JSON generator', function () { assert(fs.existsSync(path.join(output, "test2.json"))); }, done); }); + + it('should correctly generate a book with 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); + }); }); |