summaryrefslogtreecommitdiffstats
path: root/test/helper.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-22 17:06:33 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-22 17:06:33 +0100
commitbe651f0138664b35cae9a03a5c521dc138e48f2b (patch)
treea3b781681aa6948cca8d342b84aa7f1a7e995f7e /test/helper.js
parent974819bafb858ab4ed3e4a21e4cb4536234f7690 (diff)
downloadgitbook-be651f0138664b35cae9a03a5c521dc138e48f2b.zip
gitbook-be651f0138664b35cae9a03a5c521dc138e48f2b.tar.gz
gitbook-be651f0138664b35cae9a03a5c521dc138e48f2b.tar.bz2
Separate test for geenration
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 = [];