Skip to content

Commit

Permalink
Added locker.providers test to tests/locker-client-test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
smurthas committed Apr 19, 2011
1 parent 0716b36 commit 82aafa3
Showing 1 changed file with 36 additions and 11 deletions.
47 changes: 36 additions & 11 deletions tests/locker-client-test.js
Expand Up @@ -25,18 +25,43 @@ vows.describe("Locker Client API").addBatch({
}
}).addBatch({
"Public APIs" : {
topic: function() {
var promise = new events.EventEmitter;
locker.map(function(svcMap) {
if (!svcMap) promise.emit("error", svcMap);
else promise.emit("success", svcMap);
});
return promise;
"map" : {
topic: function() {
var promise = new events.EventEmitter;
locker.map(function(svcMap) {
if (!svcMap) promise.emit("error", svcMap);
else promise.emit("success", svcMap);
});
return promise;
},
"can retrieve the service map" : function (err, data) {
assert.isNull(err);
assert.include(data, "installed");
assert.include(data, "available");
}
},
"can retrieve the service map" : function (err, data) {
assert.isNull(err);
assert.include(data, "installed");
assert.include(data, "available");
"providers" : {
topic: function() {
var promise = new events.EventEmitter;
locker.providers("contact/twitter", function(providers) {
if (providers.length != 1) promise.emit("error", providers);
else if (providers[0].title != "Twitter Account") promise.emit("error", providers);
else promise.emit("success", providers);
});
return promise;
},
"can retrieve the service map" : function (err, data) {
assert.isNull(err);
assert.include(data[0], "title");
assert.include(data[0], "action");
assert.include(data[0], "desc");
assert.include(data[0], "run");
assert.include(data[0], "provides");
assert.include(data[0], "srcdir");
assert.include(data[0], "is");
assert.include(data[0], "id");
assert.include(data[0], "uri");
}
}
}
}).addBatch({
Expand Down

0 comments on commit 82aafa3

Please sign in to comment.