-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleaned up project structure a little
- Loading branch information
cloudhead
committed
Jun 1, 2010
1 parent
fb7d8a9
commit 14278d0
Showing
4 changed files
with
59 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var stylize = require('vows/console').stylize; | ||
var inspect = require('vows').inspect; | ||
|
||
require('assert').AssertionError.prototype.toString = function () { | ||
var that = this, | ||
source = this.stack.match(/([a-zA-Z0-9_-]+\.js)(:\d+):\d+/); | ||
|
||
function parse(str) { | ||
return str.replace(/{actual}/g, inspect(that.actual)). | ||
replace(/{expected}/g, inspect(that.expected)). | ||
replace(/{operator}/g, stylize(that.operator, 'bold')); | ||
} | ||
|
||
if (this.message) { | ||
return stylize(parse(this.message), 'yellow') + | ||
stylize(' // ' + source[1] + source[2], 'grey'); | ||
} else { | ||
return stylize([ | ||
this.expected, | ||
this.operator, | ||
this.actual | ||
].join(' '), 'yellow'); | ||
} | ||
}; | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
this.Context = function (vow, ctx, env) { | ||
var that = this; | ||
|
||
this.tests = vow.callback; | ||
this.topics = (ctx.topics || []).slice(0); | ||
this.emitter = null; | ||
this.env = env || {}; | ||
this.env.context = this; | ||
this.env.__defineGetter__('callback', function () { | ||
that._callback = true; | ||
return function (e, res) { | ||
var args = Array.prototype.slice.call(arguments, 1); | ||
if (e) { that.emitter.emit('error', e) } | ||
else { that.emitter.emit.apply(that.emitter, ['success'].concat(args)) } | ||
}; | ||
}); | ||
this.name = (ctx.name ? ctx.name + ' ' : '') + | ||
(vow.description || ''); | ||
}; | ||
|