Skip to content

Commit

Permalink
All green
Browse files Browse the repository at this point in the history
  • Loading branch information
floatdrop committed Jan 10, 2014
1 parent 4fe91e0 commit eb63604
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -50,12 +50,12 @@ function plumber(opts) {
stream._pipe = stream.pipe;
stream.pipe = stream.pipe2;
stream.once('readable', patchPipe.bind(null, stream));
stream._plumbed = true;
}

through.pipe2 = function pipe2(dest) {
if (dest._plumbed) {
return dest.pipe(dest);
}

if (dest._plumbed) { return dest; }

this._pipe.apply(this, arguments);

Expand Down
3 changes: 1 addition & 2 deletions test/pipePatching.js
Expand Up @@ -51,14 +51,13 @@ describe('pipe', function () {
});

it('piping into second plumber should does nothing', function (done) {
throw new Error('This test is hanging');

var lastNoop = gutil.noop();
var mario = plumber();
gulp.src(fixturesGlob)
.pipe(mario)
.pipe(gutil.noop()).pipe(gutil.noop())
.pipe(mario)
.pipe(lastNoop)
.on('end', function () {
should.exist(lastNoop._plumbed);
done();
Expand Down

0 comments on commit eb63604

Please sign in to comment.