diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ebook.js | 10 | ||||
-rw-r--r-- | test/fixtures/test4/PAGE.md | 5 | ||||
-rw-r--r-- | test/fixtures/test4/SUMMARY.md | 2 | ||||
-rw-r--r-- | test/fixtures/test4/sub/PAGE.md | 5 |
4 files changed, 15 insertions, 7 deletions
diff --git a/test/ebook.js b/test/ebook.js index 05a2000..6facd8b 100644 --- a/test/ebook.js +++ b/test/ebook.js @@ -15,9 +15,17 @@ describe('eBook Generator', function () { it('should correctly convert svg images to png', function(done) { testGeneration(books[4], "ebook", function(output) { + var pageContent = fs.readFileSync(path.join(output, "sub/PAGE.html"), {encoding: "utf8"}); + assert(fs.existsSync(path.join(output, "test.png"))); - assert(!fs.existsSync(path.join(output, "test_0.png"))); assert(fs.existsSync(path.join(output, "NewTux.png"))); + + assert(!fs.existsSync(path.join(output, "test_0.png"))); + assert(!fs.existsSync(path.join(output, "sub/test.png"))); + assert(!fs.existsSync(path.join(output, "sub/NewTux.png"))); + + assert(pageContent.indexOf('src="../test.png"') >= 0); + assert(pageContent.indexOf('src="../NewTux.png"') >= 0); }, done); }); }); diff --git a/test/fixtures/test4/PAGE.md b/test/fixtures/test4/PAGE.md deleted file mode 100644 index 0320232..0000000 --- a/test/fixtures/test4/PAGE.md +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/test/fixtures/test4/SUMMARY.md b/test/fixtures/test4/SUMMARY.md index 44a33de..3cda114 100644 --- a/test/fixtures/test4/SUMMARY.md +++ b/test/fixtures/test4/SUMMARY.md @@ -1,3 +1,3 @@ # Summary -* [Page](PAGE.md) +* [Page](sub/PAGE.md) diff --git a/test/fixtures/test4/sub/PAGE.md b/test/fixtures/test4/sub/PAGE.md new file mode 100644 index 0000000..094da59 --- /dev/null +++ b/test/fixtures/test4/sub/PAGE.md @@ -0,0 +1,5 @@ + + + + + |