summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/assertions.js2
-rw-r--r--test/mock.js2
-rw-r--r--test/output-website.js33
3 files changed, 35 insertions, 2 deletions
diff --git a/test/assertions.js b/test/assertions.js
index b936995..56da249 100644
--- a/test/assertions.js
+++ b/test/assertions.js
@@ -6,7 +6,7 @@ var should = require('should');
// Assertions to test if an Output has generated a file
should.Assertion.add('file', function(file, description) {
this.params = {
- actual: this.obj.toString(),
+ actual: this.obj.root(),
operator: 'have file ' + file,
message: description
};
diff --git a/test/mock.js b/test/mock.js
index fe8ed7a..f9cc657 100644
--- a/test/mock.js
+++ b/test/mock.js
@@ -68,7 +68,7 @@ function setupDefaultBook(files, summary, opts) {
// Output a book with a specific generator
function outputDefaultBook(Output, files, summary, opts) {
- return setupDefaultBook(files, opts)
+ return setupDefaultBook(files, summary, opts)
.then(function(book) {
// Parse the book
return book.parse()
diff --git a/test/output-website.js b/test/output-website.js
index bc15bcc..9fe1928 100644
--- a/test/output-website.js
+++ b/test/output-website.js
@@ -24,5 +24,38 @@ describe('Website Output', function() {
});
+ describe('Book with chapters', function() {
+ var output;
+
+ before(function() {
+ return mock.outputDefaultBook(WebsiteOutput, {
+ 'hello/README.md': '# Hello',
+ 'hello/test.md': '# Test'
+ }, [
+ {
+ title: 'Hello',
+ path: 'hello/README.md'
+ },
+ {
+ title: 'Test',
+ path: 'hello/test.md'
+ }
+ ])
+ .then(function(_output) {
+ output = _output;
+ });
+ });
+
+ it('should correctly generate an index.html', function() {
+ output.should.have.file('index.html');
+ });
+
+ it('should correctly generate files in folder', function() {
+ output.should.have.file('hello/index.html');
+ output.should.have.file('hello/test.html');
+ });
+
+ });
+
});