Skip to content

Commit

Permalink
Fix iojs error in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ritch committed Jun 23, 2015
1 parent 4b74a61 commit f01b8a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ describe('strong-remoting', function() {
it('should stream the file output', function(done) {
remotes.fs = fs;
fs.createReadStream.shared = true;
fs.createReadStream.accepts = [{arg: 'path', type: 'string'}];
fs.createReadStream.accepts = [
{ arg: 'path', type: 'string' },
{ arg: 'encoding', type: 'string' }
];
fs.createReadStream.returns = {arg: 'res', type: 'stream'};
fs.createReadStream.http = {
verb: 'get',
Expand All @@ -41,7 +44,7 @@ describe('strong-remoting', function() {
}
};

json('get', '/fs/createReadStream?path=' + __dirname + '/data/foo.json')
json('get', '/fs/createReadStream?path=' + __dirname + '/data/foo.json&encoding=utf8')
.expect({bar: 'baz'}, done);
});
});

1 comment on commit f01b8a6

@jorrit
Copy link
Contributor

@jorrit jorrit commented on f01b8a6 Jun 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second argument must be an object. This change causes the test to fail because fs.createReadStream(path, options) is invoked with options = utf8.

Please sign in to comment.