Skip to content
Browse files

tests

  • Loading branch information...
1 parent f07fa85 commit d5a94e8c84433c741372f0512153992e842b5eb3 Edward Hotchkiss committed Nov 29, 2011
Showing with 22 additions and 3 deletions.
  1. +4 −1 lib/version.js
  2. +18 −2 test/index.test.js
View
5 lib/version.js
@@ -5,7 +5,10 @@
@author Edward Hotchkiss
*/
-module.exports = version = function(repository, callback) {
+var fetch = exports.fetch = function(repository, callback) {
+ if (arguments.length === 1) {
+ callback = repository;
+ };
callback(null, null);
};
View
20 test/index.test.js
@@ -9,8 +9,24 @@ vows.describe("General Module Tests").addBatch({
topic:function(){
return version;
},
- "short should be a function":function(topic) {
- assert.equal(typeof(version), "function");
+ "short should be an object":function(topic) {
+ assert.equal(typeof(version), "object");
+ }
+ },
+ "when evaluating version.fetch":{
+ topic:function(){
+ return version.fetch;
+ },
+ "version.fetch should be a functon":function(topic) {
+ assert.equal(typeof(version.fetch), "function");
+ }
+ },
+ "when fetching this packages version (by using .fetch without two parameters":{
+ topic:function(){
+ version.fetch(this.callback);
+ },
+ "we should receive no error back":function(error, version) {
+ assert.equal(error, null);
}
}
}).export(module);

0 comments on commit d5a94e8

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