Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 665a6c1baa9f0ebbc51b0c419e421e6510e1aad4 1 parent 6d44e6f
@wlaurance wlaurance authored
View
1  .npmignore
@@ -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();
+ });
+ });
+ });
+ });
});
View
BIN  test_files/put/fort_knox_tank.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.