Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/add_tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
Floby committed Sep 1, 2011
2 parents b54cb4b + 062d4c1 commit 1afa61c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -14,6 +14,9 @@
"dependencies": {
"jade": "0.10.7"
},
"devDependencies": {
"vows": "*"
},
"devDependencies": {},

"main":"app.js"
Expand Down
31 changes: 31 additions & 0 deletions test/knot-interface.js
@@ -0,0 +1,31 @@
var vows = require('vows');
var assert = require('assert');
var EventEmitter = require('events').EventEmitter;


vows.describe("Knot interface").addBatch({
"The knot module": {
topic: '../lib/Knot',
"can be loaded": function(path) {
var Knot = require(path);
assert.isFunction(Knot);
assert.equal('Knot', Knot.name, 'function name');
},
"- Knot class": {
topic: function(path) {return require(path)},
"Can be instanciated": function(Knot) {
var knot = new Knot;
},
"- Knot instance": {
topic: function(Knot) {return new Knot},
"is an event emitter": function(knot) {
assert.instanceOf(knot, EventEmitter);
},
"has its created_at property automatically set": function(knot) {
assert.notEqual(knot._created_at, undefined);
assert.equal(knot._created_at.constructor, Date);
}
}
}
}
}).export(module);

0 comments on commit 1afa61c

Please sign in to comment.