From 326521bcc1c20b11f15c29bf3c6958210fea075c Mon Sep 17 00:00:00 2001 From: contra Date: Tue, 7 Jul 2015 02:20:51 -0700 Subject: [PATCH] add new glob tests, empty string is a failing glob now. https://github.com/google/material-design-lite/issues/790 --- test/dest.js | 13 ++++++++++++- test/src.js | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/test/dest.js b/test/dest.js index 2bab2cd6..4b402cb0 100644 --- a/test/dest.js +++ b/test/dest.js @@ -37,7 +37,7 @@ describe('dest stream', function() { beforeEach(wipeOut); afterEach(wipeOut); - it('should explode on invalid folder', function(done) { + it('should explode on invalid folder (empty)', function(done) { var stream; try { stream = gulp.dest(); @@ -48,6 +48,17 @@ describe('dest stream', function() { } }); + it('should explode on invalid folder (empty string)', function(done) { + var stream; + try { + stream = gulp.dest(''); + } catch (err) { + should.exist(err); + should.not.exist(stream); + done(); + } + }); + it('should pass through writes with cwd', function(done) { var inputPath = path.join(__dirname, './fixtures/test.coffee'); diff --git a/test/src.js b/test/src.js index 8b1b7fce..608569b2 100644 --- a/test/src.js +++ b/test/src.js @@ -30,6 +30,17 @@ describe('source stream', function() { } }); + it('should explode on invalid glob (empty string)', function(done) { + var stream; + try { + stream = vfs.src(''); + } catch (err) { + should.exist(err); + should.not.exist(stream); + done(); + } + }); + it('should explode on invalid glob (number)', function(done) { var stream; try { @@ -53,6 +64,17 @@ describe('source stream', function() { } }); + it('should explode on invalid glob (empty string in array)', function(done) { + var stream; + try { + stream = vfs.src(['']); + } catch (err) { + should.exist(err); + should.not.exist(stream); + done(); + } + }); + it('should not explode on invalid glob (empty array)', function(done) { var stream = vfs.src([]); stream.once('data', done);