Permalink
Browse files

Merge pull request #23 from kainosnoema/fix/destroyFile-callback

destroyFile() isn't calling callback on failure
  • Loading branch information...
2 parents f5654ea + 2bc3123 commit ef476afd48ba611b4a1f8c7ab5254ba774274546 @bmeck bmeck committed Dec 21, 2011
Showing with 9 additions and 1 deletion.
  1. +1 −1 lib/cloudfiles/core.js
  2. +8 −0 test/storage-object-test.js
View
@@ -391,7 +391,7 @@ Cloudfiles.prototype.addFile = function (container, options, callback) {
// Destroys the `file` in the specified `container`.
//
Cloudfiles.prototype.destroyFile = function (container, file, callback) {
- common.rackspace('DELETE', this.storageUrl(container, file), this, function (body, res) {
+ common.rackspace('DELETE', this.storageUrl(container, file), this, callback, function (body, res) {
callback(null, true);
});
};
@@ -129,6 +129,14 @@ vows.describe('node-cloudfiles/storage-object').addBatch(helpers.requireAuth(cli
assert.isTrue(deleted);
}
}
+ , "for a file that does not exist": {
+ topic: function () {
+ client.destroyFile('test_container', 'file0.txt', this.callback);
+ },
+ "should return error": function (err, deleted) {
+ assert.ok(err instanceof Error);
+ }
+ }
}
}
}).addBatch({

0 comments on commit ef476af

Please sign in to comment.