diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-09-14 18:26:26 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-09-14 18:26:26 +0200 |
commit | afd5465a6129e96bce62dab26a4ee41e7af7365c (patch) | |
tree | 6e500ed55e65a6f6e5991913f11850d17c8ed721 /test/helper.js | |
parent | 3bf592f870eb24d1b4753fa538bad2cbfaa98a24 (diff) | |
parent | fe604733debe42a287f3c44705e16d9d0ec85908 (diff) | |
download | gitbook-afd5465a6129e96bce62dab26a4ee41e7af7365c.zip gitbook-afd5465a6129e96bce62dab26a4ee41e7af7365c.tar.gz gitbook-afd5465a6129e96bce62dab26a4ee41e7af7365c.tar.bz2 |
Merge pull request #928 from GitbookIO/feature/highlight_block
Code highlighting extended by plugins
Diffstat (limited to 'test/helper.js')
-rw-r--r-- | test/helper.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/helper.js b/test/helper.js index f6b671b..f4432a9 100644 --- a/test/helper.js +++ b/test/helper.js @@ -17,10 +17,18 @@ var TMPDIR = os.tmpdir(); // Generate and return a book -function generateBook(bookId, test) { +function generateBook(bookId, test, opts) { + opts = _.defaults(opts || {}, { + prepare: function() {} + }); + return parseBook(bookId, test) .then(function(book) { - return book.generate(test) + + return Q(opts.prepare(book)) + .then(function() { + return book.generate(test); + }) .thenResolve(book); }); } |