From 52cb7274c7ed3f4156bc19ef618508d276924665 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Fri, 7 Nov 2014 15:17:05 -0500 Subject: [PATCH] add regression test --- regression/storage.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/regression/storage.js b/regression/storage.js index 0cc0f87f3c3..48ca3708fe4 100644 --- a/regression/storage.js +++ b/regression/storage.js @@ -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');