summaryrefslogtreecommitdiffstats
path: root/test/helper.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/helper.js')
-rw-r--r--test/helper.js12
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);
});
}