Skip to content

Commit

Permalink
add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Nov 7, 2014
1 parent 3877b50 commit 52cb727
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions regression/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,25 @@ describe('storage', function() {
});
});

it('should read/write from/to a file in a directory', function(done) {
var file = bucket.file('directory/file');
var contents = 'test';

var writeStream = file.createWriteStream();
writeStream.write(contents);
writeStream.end();

writeStream.on('error', done);
writeStream.on('complete', function() {
file.createReadStream()
.on('data', function(chunk) {
assert.equal(String(chunk), contents);
})
.on('error', done)
.on('end', done);
});
});

describe('stream write', function() {
it('should stream write, then remove large file (5mb)', function(done) {
var file = bucket.file('LargeFile');
Expand Down

0 comments on commit 52cb727

Please sign in to comment.