summaryrefslogtreecommitdiffstats
path: root/test/helper.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/helper.js')
-rw-r--r--test/helper.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/helper.js b/test/helper.js
index 27d5f01..6e167ea 100644
--- a/test/helper.js
+++ b/test/helper.js
@@ -14,6 +14,21 @@ global.qdone = function qdone(promise, done) {
}).done();
};
+// Test generation of a book
+global.testGeneration = function(book, type, func, done) {
+ var OUTPUT_PATH = book.options.output;
+
+ qdone(
+ book.generate(type)
+ .then(function() {
+ func(OUTPUT_PATH);
+ })
+ .fin(function() {
+ return fsUtil.remove(OUTPUT_PATH);
+ }),
+ done);
+};
+
// Books for testings
global.books = [];