summaryrefslogtreecommitdiffstats
path: root/test/init.js
blob: 3ba701f7bbecd89537c1a07809d01d55c3a9d33c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
    });
});