Permalink
Browse files

Put File

Add failing test

Add test_files to .npmignore - don't want to make the package big with
test images/resources
  • Loading branch information...
1 parent 6d44e6f commit 665a6c1baa9f0ebbc51b0c419e421e6510e1aad4 @wlaurance wlaurance committed Jul 16, 2013
Showing with 15 additions and 1 deletion.
  1. +1 −0 .npmignore
  2. +14 −1 test.js
  3. BIN test_files/put/fort_knox_tank.jpg
View
@@ -0,0 +1 @@
+test_files
View
15 test.js
@@ -18,7 +18,7 @@ describe('Faux-Knox', function(){
async.each(methods, checker, done);
});
});
- describe('Functional', function(){
+ describe('getFile', function(){
var client = knox.createClient({bucket:'./test_files'});
it('should get a file', function(done){
client.getFile('path/to/test.json', null, function(err, cres){
@@ -49,4 +49,17 @@ describe('Faux-Knox', function(){
});
});
});
+ describe('putFile', function(){
+ var client = knox.createClient({bucket:'./test_files'});
+ it('should put a file into bucket', function(done){
+ client.putFile('./test_files/put/fort_knox_tank.jpg', 'from/fort/knox/super_tank.jpg', function(err, res){
+ res.should.have.property('headers');
+ res.headers.should.have.property('statusCode', 201);
+ fs.exists('./test_files/from/fort/knox/supert_tank.jpg', function(existy){
+ existy.should.be.true;
+ done();
+ });
+ });
+ });
+ });
});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 665a6c1

Please sign in to comment.