blob: 54e7daeb001d15f4810e0ce732967afbee65c6d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
var Book = require('../../models/book');
var createMockFS = require('../../fs/mock');
describe('parseIgnore', function() {
var parseIgnore = require('../parseIgnore');
var fs = createMockFS({
'.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'
});
function getBook() {
var book = Book.createForFS(fs);
return parseIgnore(book);
}
it('should load rules from .ignore', function() {
return getBook()
.then(function(book) {
expect(book.isFileIgnored('test-1.js')).toBeTruthy();
});
});
it('should load rules from .gitignore', function() {
return getBook()
.then(function(book) {
expect(book.isFileIgnored('test-2.js')).toBeTruthy();
});
});
it('should load rules from .bookignore', function() {
return getBook()
.then(function(book) {
expect(book.isFileIgnored('test-3.js')).toBeFalsy();
});
});
});
|