Skip to content

Commit

Permalink
add failing tests for negation in glob arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 14, 2013
1 parent 0730064 commit 576f837
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/src.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,50 @@ describe('gulp input stream', function() {
});
});

it('should return a input stream for multiple globs, with negation', function(done) {
var expectedPath = join(__dirname, "./fixtures/stuff/run.dmc");
var globArray = [
join(__dirname, "./fixtures/stuff/*.dmc"),
'!' + join(__dirname, "./fixtures/stuff/test.dmc"),
];
var stream = gulp.src(globArray);

var files = [];
stream.on('error', done);
stream.on('data', function(file) {
should.exist(file);
should.exist(file.path);
files.push(file);
});
stream.on('end', function() {
files.length.should.equal(1);
files[0].path.should.equal(expectedPath);
done();
});
});

it('should return a input stream for multiple globs, with negation', function(done) {
var expectedPath = join(__dirname, "./fixtures/stuff/run.dmc");
var globArray = [
join(__dirname, "./fixtures/stuff/run.dmc"),
'!' + join(__dirname, "./fixtures/stuff/test.dmc"),
];
var stream = gulp.src(globArray);

var files = [];
stream.on('error', done);
stream.on('data', function(file) {
should.exist(file);
should.exist(file.path);
files.push(file);
});
stream.on('end', function() {
files.length.should.equal(1);
files[0].path.should.equal(expectedPath);
done();
});
});

it('should return a input stream with no contents when read is false', function(done) {
var stream = gulp.src(join(__dirname, "./fixtures/*.coffee"), {read: false});
stream.on('error', done);
Expand Down

0 comments on commit 576f837

Please sign in to comment.