Skip to content

Commit

Permalink
Merge pull request gulpjs#53 from phated/master
Browse files Browse the repository at this point in the history
add failing tests for negation in glob arrays
  • Loading branch information
yocontra committed Dec 14, 2013
2 parents 0730064 + 576f837 commit d96b21c
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 d96b21c

Please sign in to comment.