diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-10-08 20:58:57 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-10-08 20:58:57 +0200 |
commit | 4ae5b2e05001df9bdf8c5b64f8a82725e14d6414 (patch) | |
tree | 2e4397d33f90ee7bf1034ec4dea1237e611aff36 /test | |
parent | ce1e0e187339976fc3cae7ef70bcfdd0eaf68981 (diff) | |
parent | 4369bd8f5e39b1b3563e527fb78c16fc3b34b597 (diff) | |
download | gitbook-4ae5b2e05001df9bdf8c5b64f8a82725e14d6414.zip gitbook-4ae5b2e05001df9bdf8c5b64f8a82725e14d6414.tar.gz gitbook-4ae5b2e05001df9bdf8c5b64f8a82725e14d6414.tar.bz2 |
Merge pull request #959 from GitbookIO/improvements/ebooks
Improvements for ebooks
Diffstat (limited to 'test')
-rw-r--r-- | test/ebook.js | 46 | ||||
-rw-r--r-- | test/website.js | 22 |
2 files changed, 38 insertions, 30 deletions
diff --git a/test/ebook.js b/test/ebook.js index b065ae7..6c84462 100644 --- a/test/ebook.js +++ b/test/ebook.js @@ -1,66 +1,70 @@ -var fs = require("fs"); -var path = require("path"); +var fs = require('fs'); +var path = require('path'); -describe("eBook generator", function () { - describe("Basic Book", function() { +describe('eBook generator', function () { + describe('Basic Book', function() { var book; before(function() { - return books.generate("basic", "ebook") + return books.generate('basic', 'ebook') .then(function(_book) { book = _book; }); }); - it("should correctly output a SUMMARY.html", function() { - book.should.have.file("SUMMARY.html"); + it('should correctly output a SUMMARY.html', function() { + book.should.have.file('SUMMARY.html'); }); - it("should correctly copy assets", function() { - book.should.have.file("gitbook"); - book.should.have.file("gitbook/style.css"); + it('should correctly copy assets', function() { + book.should.have.file('gitbook'); + book.should.have.file('gitbook/ebook.css'); + }); + + it('should not copy website assets', function() { + book.should.not.have.file('gitbook/style.css'); }); }); - describe("Custom styles", function() { + describe('Custom styles', function() { var book; before(function() { - return books.generate("style-print", "ebook") + return books.generate('style-print', 'ebook') .then(function(_book) { book = _book; }); }); - it("should remove default print.css", function() { + it('should remove default print.css', function() { var PAGE = fs.readFileSync( - path.join(book.options.output, "index.html"), - { encoding: "utf-8" } + path.join(book.options.output, 'index.html'), + { encoding: 'utf-8' } ); // There are 2 styles (one from plugin-highlight and the new style) PAGE.should.be.html({ - "link": { + 'link': { count: 2 } }); PAGE.should.be.html({ - "link[href=\"./styles/print.css\"]": { + 'link[href=\'./styles/print.css\']': { count: 1 } }); PAGE.should.be.html({ - "link[href=\"gitbook/plugins/gitbook-plugin-highlight/ebook.css\"]": { + 'link[href="gitbook/plugins/gitbook-plugin-highlight/ebook.css"]': { count: 1 } }); }); - it("should correctly print.css", function() { - book.should.have.file("styles"); - book.should.have.file("styles/print.css"); + it('should correctly copy print.css', function() { + book.should.have.file('styles'); + book.should.have.file('styles/print.css'); }); }); }); diff --git a/test/website.js b/test/website.js index ebbd18c..6a0fd1c 100644 --- a/test/website.js +++ b/test/website.js @@ -1,22 +1,26 @@ -describe("Website generator", function () { - describe("Basic Book", function() { +describe('Website generator', function () { + describe('Basic Book', function() { var book; before(function() { - return books.generate("basic", "website") + return books.generate('basic', 'website') .then(function(_book) { book = _book; }); }); - it("should correctly output an index.html", function() { - book.should.have.file("index.html"); + it('should correctly output an index.html', function() { + book.should.have.file('index.html'); }); - it("should correctly copy assets", function() { - book.should.have.file("gitbook"); - book.should.have.file("gitbook/app.js"); - book.should.have.file("gitbook/style.css"); + it('should correctly copy assets', function() { + book.should.have.file('gitbook'); + book.should.have.file('gitbook/app.js'); + book.should.have.file('gitbook/style.css'); + }); + + it('should not copy ebook assets', function() { + book.should.not.have.file('gitbook/ebook.css'); }); }); }); |