var fs = require('fs');
var endpoint = require('endpoint');

describe('Writeable Stream Input API', function () {

  var feedPath = __dirname + '/feeds/rss2sample.xml';

  describe('.pipe()', function () {
    it('works', function (done) {
      var events = [];

      fs.createReadStream(feedPath).pipe(FeedParser())
        .on('error', function (err) {
          assert.ifError(err);
          events.push('error');
        })
        .on('meta', function (meta) {
          assert.notEqual(meta, null);
          events.push('meta');
        })
        .on('article', function (article) {
          assert.notEqual(article, null);
          events.push('article');
        })
        .on('complete', function (meta, articles) {
          assert.notEqual(meta, null);
          assert.ok(articles.length);
          events.push('complete');
        })
        .on('end', function () {
          assert.equal(events.indexOf('error'), -1);
          assert.ok(~events.indexOf('meta'));
          assert.ok(~events.indexOf('article'));
          assert.ok(~events.indexOf('complete'));
          done();
        })
        .resume();
    });
  });

  describe('.pipe()', function () {
    it('works', function (done) {
      fs.createReadStream(feedPath)
        .pipe(FeedParser())
        .pipe(endpoint({objectMode: true}, function (err, articles) {
          assert.equal(err, null);
          assert.ok(articles.length);
          done();
        }));
    });
  });

});
@@ -20,44 +20,8 @@
 s');
-%0Avar endpoint = require('endpoint');
 %0A%0Ade
@@ -1254,104 +1254,167 @@
    .
-pipe(endpoint(%7BobjectMode: true%7D, function (err, articles) %7B%0A          assert.equal(err, null
+on('readable', function () %7B%0A          var stream = this, items = %5B%5D, item;%0A          while (item = stream.read()) %7B%0A            items.push(item
 );%0A
+          %7D%0A
     
@@ -1421,39 +1421,36 @@
       assert.ok(
-article
+item
 s.length);%0A     
@@ -1448,33 +1448,51 @@
 h);%0A        
- 
+%7D)%0A        .on('end',
  done
-();
+)
 %0A        %7D))
@@ -1488,18 +1488,33 @@
         
-%7D)
+.on('error', done
 );%0A    %7D

Change stream test to not require additional dependency