Skip to content

Commit

Permalink
First test passed
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosvillu committed Jan 9, 2011
1 parent 3a6a66b commit 82cb070
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/dribbble.js
@@ -0,0 +1,21 @@
//
// Dribbble.js is a client for the Dribbble´s API (http://http://dribbble.com/api)
// Usage:
// var dribbble = require('dribbble');
// var callback = function(shot, err){
// if(!err) console.log(shot);
// }
//
// dribbble.shots(21603, callback);
//

var dribbble = exports;



//
// This function get the shot for a espeficed :id, then call the callback with
// callback = function(shot, err). `shot` is a object all informaction about the shot.
// If any error then `err` is not null.
//
dribbble.shots = function(id, callback){}
49 changes: 49 additions & 0 deletions test/test-client.js
@@ -0,0 +1,49 @@
var vows = require('vows'),
assert = require('assert'),
sys = require('sys');

var dribbble = require('./../lib/dribbble');

// Suite for testing the client.
var client_suite = vows.describe("Basic tests for Dribbble´s client");
client_suite.addBatch({
"A Dribbble client": {
topic: dribbble,
"should be a object": function(topic){
assert.ok(typeof topic === 'object');
},
"Should have a function to get the 'shots'":function(topic){
assert.ok(typeof topic.shots === 'function');
},
"Should have a function to get a set of rebounds":function(topic){
assert.ok(typeof topic.rebounds === 'function');
},
"Should have a function to get the set of comments for the shot specified":function(topic){
assert.ok(typeof topic.comments === 'function');
},
"Should have a function to get the list of shots":function(topic){
assert.ok(typeof topic.list === 'function');
},
"Should have a function to get the most recent shots for the player":function(topic){
assert.ok(typeof topic.shots_for_player === 'function');
},
"Should have a function to get the most recent shots published by those the player":function(topic){
assert.ok(typeof topic.shots_following_for_player === 'function');
},
"Should have a function to get shots liked by the player":function(topic){
assert.ok(typeof topic.shots_likes_for_player === 'function');
},
"Should have a function to get the player":function(topic){
assert.ok(typeof topic.player === 'function');
},
"Should have a function to get the player followers":function(topic){
assert.ok(typeof topic.player_followers === 'function');
},
"Should have a function to get the player following":function(topic){
assert.ok(typeof topic.player_following === 'function');
},
"Should have a function to get the list of players drafted":function(topic){
assert.ok(typeof topic.player_draftees === 'function');
}
},
}).export(module);

0 comments on commit 82cb070

Please sign in to comment.