diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-22 17:06:33 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-22 17:06:33 +0100 |
commit | be651f0138664b35cae9a03a5c521dc138e48f2b (patch) | |
tree | a3b781681aa6948cca8d342b84aa7f1a7e995f7e /test/helper.js | |
parent | 974819bafb858ab4ed3e4a21e4cb4536234f7690 (diff) | |
download | gitbook-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.js | 15 |
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 = []; |