Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

yeah, i like this format

  • Loading branch information...
commit 806d98dff8524819be7ab7c88a29fcaa0e7dffc1 1 parent 7096f5c
Edward Hotchkiss authored
Showing with 15 additions and 14 deletions.
  1. +12 −4 lib/version.js
  2. +3 −10 test/index.test.js
16 lib/version.js
View
@@ -5,10 +5,18 @@
@author Edward Hotchkiss
*/
-var fetch = exports.fetch = function(repository, callback) {
- if (arguments.length === 1) {
- callback = repository;
- };
+module.exports = version = function(){};
+
+/*
+ version.fetch
+ @class version
+ @method fetch
+ @param {String} npm module name
+ @param {Function} callback
+ @returns {Object} error {String} version
+*/
+
+version.fetch = function(name, callback) {
callback(null, null);
};
13 test/index.test.js
View
@@ -9,21 +9,14 @@ vows.describe("General Module Tests").addBatch({
topic:function(){
return version;
},
- "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) {
+ "version should be an object and version.fetch and should be a function":function(topic) {
+ assert.equal(typeof(version), "function");
assert.equal(typeof(version.fetch), "function");
}
},
"when fetching this packages version (by using .fetch without two parameters":{
topic:function(){
- version.fetch(this.callback);
+ version.fetch("version", this.callback);
},
"we should receive no error back":function(error, version) {
assert.equal(error, null);
Please sign in to comment.
Something went wrong with that request. Please try again.