Permalink
Browse files

Change stream test to not require additional dependency

  • Loading branch information...
1 parent 6f77076 commit 0ae4bd419f733504d8dd840a8725f6d800196136 @danmactough committed Jun 11, 2013
Showing with 9 additions and 6 deletions.
  1. +9 −6 test/api-stream.js
View
@@ -1,5 +1,4 @@
var fs = require('fs');
-var endpoint = require('endpoint');
describe('Writeable Stream Input API', function () {
@@ -42,11 +41,15 @@ describe('Writeable Stream Input API', 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();
- }));
+ .on('readable', function () {
+ var stream = this, items = [], item;
+ while (item = stream.read()) {
+ items.push(item);
+ }
+ assert.ok(items.length);
+ })
+ .on('end', done)
+ .on('error', done);
});
});

0 comments on commit 0ae4bd4

Please sign in to comment.