diff options
Diffstat (limited to 'test/init.js')
-rw-r--r-- | test/init.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/init.js b/test/init.js new file mode 100644 index 0000000..3ba701f --- /dev/null +++ b/test/init.js @@ -0,0 +1,23 @@ +var fs = require('fs'); +var path = require('path'); +var should = require('should'); + +var Book = require('../').Book; +var LOG_LEVELS = require('../').LOG_LEVELS; + +describe('Init Books', function () { + var initRoot; + + before(function() { + initRoot = path.resolve(__dirname, "books/init"); + return Book.init(initRoot, { + logLevel: LOG_LEVELS.DISABLED, + }); + }); + + it('should create all chapters', function() { + should(fs.existsSync(path.resolve(initRoot, "hello.md"))).be.ok; + should(fs.existsSync(path.resolve(initRoot, "hello2.md"))).be.ok; + should(fs.existsSync(path.resolve(initRoot, "hello3/hello4.md"))).be.ok; + }); +}); |