summaryrefslogtreecommitdiffstats
path: root/test/ignore.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-04-08 15:48:33 +0200
committerSamy Pessé <samypesse@gmail.com>2016-04-08 15:48:33 +0200
commitbd4ef2354e9f472507646282fcb0fccf596aaece (patch)
tree1e59072063c96b1e1b4593bd008081d48579d253 /test/ignore.js
parent7ade91a091f5e4c0c193c4df294192e469abd504 (diff)
parent32a49a6969ad57cb8cc8a28c2b1db8c6779c653d (diff)
downloadgitbook-bd4ef2354e9f472507646282fcb0fccf596aaece.zip
gitbook-bd4ef2354e9f472507646282fcb0fccf596aaece.tar.gz
gitbook-bd4ef2354e9f472507646282fcb0fccf596aaece.tar.bz2
Merge pull request #1216 from GitbookIO/fix/ignore
Fix #1215: fix ignore rules not working
Diffstat (limited to 'test/ignore.js')
-rw-r--r--test/ignore.js33
1 files changed, 33 insertions, 0 deletions
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');
+ });
+});
+