diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-08 15:23:46 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-08 15:23:46 +0200 |
commit | 21806687e696a1220995959c96e12e4fdc631b0c (patch) | |
tree | e2c03ca44811a13dffcb44b494fb121203ba52f6 | |
parent | 7ade91a091f5e4c0c193c4df294192e469abd504 (diff) | |
download | gitbook-21806687e696a1220995959c96e12e4fdc631b0c.zip gitbook-21806687e696a1220995959c96e12e4fdc631b0c.tar.gz gitbook-21806687e696a1220995959c96e12e4fdc631b0c.tar.bz2 |
Add base tests for fiailng ignore
-rw-r--r-- | test/all.js | 1 | ||||
-rw-r--r-- | test/ignore.js | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/test/all.js b/test/all.js index cb4e605..00046b5 100644 --- a/test/all.js +++ b/test/all.js @@ -19,6 +19,7 @@ require('./git'); require('./plugins'); require('./template'); require('./conrefs'); +require('./ignore'); // Page and HTML generation require('./page'); diff --git a/test/ignore.js b/test/ignore.js new file mode 100644 index 0000000..e8d833c --- /dev/null +++ b/test/ignore.js @@ -0,0 +1,33 @@ +var mock = require('./mock'); +var WebsiteOutput = require('../lib/output/website'); + +describe('Ignore', function() { + var output; + + before(function() { + return mock.outputDefaultBook(WebsiteOutput, { + '.ignore': 'test-1.js', + '.gitignore': 'test-2.js\ntest-3.js', + '.bookignore': '!test-3.js', + 'test-1.js': '1', + 'test-2.js': '2', + 'test-3.js': '3' + }) + .then(function(_output) { + output = _output; + }); + }); + + it('should load rules from .ignore', function() { + output.should.not.have.file('test-1.js'); + }); + + it('should load rules from .gitignore', function() { + output.should.not.have.file('test-2.js'); + }); + + it('should load rules from .bookignore', function() { + output.should.have.file('test-3.js'); + }); +}); + |