Skip to content

Commit

Permalink
Change stream test to not require additional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
danmactough committed Jun 11, 2013
1 parent 6f77076 commit 0ae4bd4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/api-stream.js
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,4 @@
var fs = require('fs'); var fs = require('fs');
var endpoint = require('endpoint');


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


Expand Down Expand Up @@ -42,11 +41,15 @@ describe('Writeable Stream Input API', function () {
it('works', function (done) { it('works', function (done) {
fs.createReadStream(feedPath) fs.createReadStream(feedPath)
.pipe(FeedParser()) .pipe(FeedParser())
.pipe(endpoint({objectMode: true}, function (err, articles) { .on('readable', function () {
assert.equal(err, null); var stream = this, items = [], item;
assert.ok(articles.length); while (item = stream.read()) {
done(); items.push(item);
})); }
assert.ok(items.length);
})
.on('end', done)
.on('error', done);
}); });
}); });


Expand Down

0 comments on commit 0ae4bd4

Please sign in to comment.