Skip to content
Browse files

adding getFileInfo tests

  • Loading branch information...
1 parent edcd962 commit b396491e0848516796b1f4924320cedfa8ebeaf3 @bog committed Apr 20, 2012
Showing with 23 additions and 0 deletions.
  1. +23 −0 test/storage-object-test.js
View
23 test/storage-object-test.js
@@ -116,6 +116,29 @@ vows.describe('node-cloudfiles/storage-object').addBatch(helpers.requireAuth(cli
}
}).addBatch({
"The node-cloudfiles client": {
+ "the getFileInfo() method": {
+ "for a file that exists": {
+ topic: function () {
+ client.getFileInfo('test_container', 'file2.txt', this.callback);
+ },
+ "should return a valid StorageObject": function (err, file) {
+ helpers.assertFile(file);
+ assert.isNull(file.local);
+ testData.file = file;
+ }
+ }
+ , "for a file that does not exist": {
+ topic: function () {
+ client.getFileInfo('test_container', 'file0.txt', this.callback);
+ },
+ "should return an error": function (err, file) {
+ assert.ok(err instanceof Error);
+ }
+ }
+ }
+ }
+}).addBatch({
+ "The node-cloudfiles client": {
"an instance of StorageObject": {
"the save() method": {
topic: function () {

0 comments on commit b396491

Please sign in to comment.
Something went wrong with that request. Please try again.