diff options
-rw-r--r-- | lib/book.js | 8 | ||||
-rw-r--r-- | test/parse.js | 11 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/book.js b/lib/book.js index d0e415c..acfaece 100644 --- a/lib/book.js +++ b/lib/book.js @@ -216,7 +216,13 @@ Book.prototype.parse = function() { }) // Parse the glossary - .then(that.glossary.load); + .then(that.glossary.load) + + // Add the glossary as a page + .then(function() { + if (!that.glossary.exists()) return; + that.addPage(that.glossary.path); + }); }); }; diff --git a/test/parse.js b/test/parse.js index 72e0260..e190107 100644 --- a/test/parse.js +++ b/test/parse.js @@ -19,6 +19,17 @@ describe('Parsing', function() { }); }); + it('should add GLOSSARY as a page', function() { + return mock.setupDefaultBook({ + 'GLOSSARY.md': '' + }) + .then(function(book) { + return book.parse() + .then(function() { + book.hasPage('GLOSSARY.md').should.equal(true); + }); + }); + }); describe('Multilingual book', function() { var book; |