mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-24 19:32:07 +00:00
Fix #765: in init handle correctly empty entries
Add tests for it, fix #769
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
*
|
||||
!SUMMARY.md
|
||||
!.gitignore
|
||||
@@ -0,0 +1,6 @@
|
||||
# Summary
|
||||
|
||||
* [Hello](hello.md)
|
||||
* [Hello 2](hello2.md)
|
||||
* Hello 3
|
||||
* [Hello 4](hello3/hello4.md)
|
||||
@@ -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;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user