diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-15 09:44:05 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-15 09:44:05 +0100 |
commit | d7077fc7db130d91f117dbf7ef01ec6ff5c6fb8e (patch) | |
tree | 83d8f8439595c7ff481adf7dbaeb5ca7c23bd45c /test/mock.js | |
parent | d6bd4a0d67dd2f61e667aefebf96e279f607ce54 (diff) | |
download | gitbook-d7077fc7db130d91f117dbf7ef01ec6ff5c6fb8e.zip gitbook-d7077fc7db130d91f117dbf7ef01ec6ff5c6fb8e.tar.gz gitbook-d7077fc7db130d91f117dbf7ef01ec6ff5c6fb8e.tar.bz2 |
Add test for page.title variable
Diffstat (limited to 'test/mock.js')
-rw-r--r-- | test/mock.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/mock.js b/test/mock.js index 127e35c..ce4dca5 100644 --- a/test/mock.js +++ b/test/mock.js @@ -49,15 +49,21 @@ function setupBook(files, opts) { } // Setup a book with default README/SUMMARY -function setupDefaultBook(files, opts) { +function setupDefaultBook(files, summary, opts) { + var summaryContent = '# Summary \n\n' + + _.map(summary, function(article) { + return '* [' + article.title +'](' + article.path + ')'; + }) + .join('\n'); + return setupBook(_.defaults(files || {}, { 'README.md': 'Hello', - 'SUMMARY.md': '# Summary' + 'SUMMARY.md': summaryContent }), opts); } // Output a book with a specific generator -function outputDefaultBook(Output, files, opts) { +function outputDefaultBook(Output, files, summary, opts) { return setupDefaultBook(files, opts) .then(function(book) { // Parse the book |