Comparing version 0.5.11 to 0.5.12
@@ -6,3 +6,7 @@ var stylize = require('../vows/console').stylize; | ||
var that = this, | ||
source; | ||
if (this.stack) { | ||
source = this.stack.match(/([a-zA-Z0-9._-]+\.js)(:\d+):\d+/); | ||
} | ||
@@ -19,3 +23,3 @@ function parse(str) { | ||
return stylize(parse(this.message), 'yellow') + | ||
stylize(' // ' + source[1] + source[2], 'grey'); | ||
(source) ? stylize(' // ' + source[1] + source[2], 'grey') : ''; | ||
} else { | ||
@@ -22,0 +26,0 @@ return stylize([ |
@@ -113,3 +113,3 @@ var assert = require('assert'), | ||
assert.length = function (actual, expected, message) { | ||
assert.lengthOf = function (actual, expected, message) { | ||
if (actual.length !== expected) { | ||
@@ -116,0 +116,0 @@ assert.fail(actual, expected, message || "expected {actual} to have {expected} element(s)", "length", assert.length); |
@@ -18,3 +18,3 @@ // | ||
// | ||
var sys = require('sys'), | ||
var util = require('util'), | ||
path = require('path'), | ||
@@ -85,4 +85,2 @@ events = require('events'), | ||
function runTest(args, ctx) { | ||
var topic, status; | ||
if (vow.callback instanceof String) { | ||
@@ -146,3 +144,3 @@ return output('pending'); | ||
if (unFired.length > 0) { sys.print('\n') } | ||
if (unFired.length > 0) { util.print('\n') } | ||
@@ -167,3 +165,3 @@ unFired.forEach(function (title) { | ||
if (failure) { | ||
sys.puts(console.result(results)); | ||
util.puts(console.result(results)); | ||
} | ||
@@ -196,3 +194,4 @@ }); | ||
vows.version = require('fs').readFileSync(path.join(__dirname, '..', 'package.json')) | ||
.toString().match(/"version"\s*:\s*"([\d.]+)"/)[1]; | ||
vows.version = JSON.parse(require('fs') | ||
.readFileSync(path.join(__dirname, '..', 'package.json'))) | ||
.version |
@@ -1,2 +0,2 @@ | ||
var sys = require('sys'), | ||
var util = require('util'), | ||
fs = require('fs'), | ||
@@ -24,3 +24,3 @@ file = require('./file'); | ||
} catch (error) { | ||
sys.print("Error: Unable to write to file coverage.html\n"); | ||
util.print("Error: Unable to write to file coverage.html\n"); | ||
return; | ||
@@ -55,2 +55,2 @@ } | ||
fs.close(out); | ||
}; | ||
}; |
@@ -1,2 +0,2 @@ | ||
var sys = require('sys'), | ||
var util = require('util'), | ||
fs = require('fs'), | ||
@@ -51,5 +51,5 @@ file = require('./file'); | ||
} catch (error) { | ||
sys.print("Error: Unable to write to file coverage.json\n"); | ||
util.print("Error: Unable to write to file coverage.json\n"); | ||
return; | ||
} | ||
}; | ||
}; |
@@ -1,2 +0,2 @@ | ||
var sys = require('sys'), | ||
var util = require('util'), | ||
file = require('./file'); | ||
@@ -27,13 +27,13 @@ | ||
sys.print(filename + ":\n"); | ||
sys.print("[ hits: " + data.hits + ", misses: " + data.misses); | ||
sys.print(", sloc: " + data.sloc + ", coverage: " + data.coverage.toFixed(2) + "% ]\n"); | ||
util.print(filename + ":\n"); | ||
util.print("[ hits: " + data.hits + ", misses: " + data.misses); | ||
util.print(", sloc: " + data.sloc + ", coverage: " + data.coverage.toFixed(2) + "% ]\n"); | ||
for (var i = 0; i < data.source.length; i++) { | ||
sys.print(lpad(data.source[i].coverage, 5) + " | " + data.source[i].line + "\n"); | ||
util.print(lpad(data.source[i].coverage, 5) + " | " + data.source[i].line + "\n"); | ||
} | ||
sys.print("\n"); | ||
util.print("\n"); | ||
} | ||
} | ||
}; | ||
}; |
@@ -1,2 +0,2 @@ | ||
var sys = require('sys'); | ||
var util = require('util'); | ||
@@ -31,3 +31,3 @@ var options = { tail: '\n' }; | ||
case 'end': | ||
sys.print('\n'); | ||
util.print('\n'); | ||
break; | ||
@@ -44,3 +44,3 @@ case 'finish': | ||
this.print = function (str) { | ||
sys.print(str); | ||
util.print(str); | ||
}; |
@@ -1,3 +0,1 @@ | ||
var sys = require('sys'); | ||
var options = {}; | ||
@@ -4,0 +2,0 @@ var console = require('../../vows/console'); |
@@ -12,4 +12,5 @@ { | ||
"directories" : { "test": "./test", "bin": "./bin" }, | ||
"version" : "0.5.11", | ||
"version" : "0.5.12", | ||
"scripts" : {"test": "./bin/vows --spec"}, | ||
"engines" : {"node": ">=0.2.6"} | ||
} |
@@ -40,1 +40,8 @@ Vows | ||
authors | ||
------- | ||
Alexis Sellier <<alexis@cloudhead.io>>, Charlie Robbins, | ||
*...and many others* | ||
@@ -6,20 +6,18 @@ var vows = require('../lib/vows'); | ||
"The Assertion module": { | ||
topic: require('assert'), | ||
"`equal`": function (assert) { | ||
"`equal`": function () { | ||
assert.equal("hello world", "hello world"); | ||
assert.equal(1, true); | ||
}, | ||
"`match`": function (assert) { | ||
"`match`": function () { | ||
assert.match("hello world", /^[a-z]+ [a-z]+$/); | ||
}, | ||
"`length`": function (assert) { | ||
assert.length("hello world", 11); | ||
assert.length([1, 2, 3], 3); | ||
"`length`": function () { | ||
assert.lengthOf("hello world", 11); | ||
assert.lengthOf([1, 2, 3], 3); | ||
}, | ||
"`isDefined`": function (assert) { | ||
"`isDefined`": function () { | ||
assert.isDefined(null); | ||
assertError(assert.isDefined, undefined); | ||
}, | ||
"`include`": function (assert) { | ||
"`include`": function () { | ||
assert.include("hello world", "world"); | ||
@@ -29,3 +27,3 @@ assert.include([0, 42, 0], 42); | ||
}, | ||
"`deepInclude`": function (assert) { | ||
"`deepInclude`": function () { | ||
assert.deepInclude([{a:'b'},{c:'d'}], {a:'b'}); | ||
@@ -35,3 +33,3 @@ assert.deepInclude("hello world", "world"); | ||
}, | ||
"`typeOf`": function (assert) { | ||
"`typeOf`": function () { | ||
assert.typeOf('goo', 'string'); | ||
@@ -43,21 +41,21 @@ assert.typeOf(42, 'number'); | ||
}, | ||
"`instanceOf`": function (assert) { | ||
"`instanceOf`": function () { | ||
assert.instanceOf([], Array); | ||
assert.instanceOf(function () {}, Function); | ||
}, | ||
"`isArray`": function (assert) { | ||
"`isArray`": function () { | ||
assert.isArray([]); | ||
assertError(assert.isArray, {}); | ||
}, | ||
"`isString`": function (assert) { | ||
"`isString`": function () { | ||
assert.isString(""); | ||
}, | ||
"`isObject`": function (assert) { | ||
"`isObject`": function () { | ||
assert.isObject({}); | ||
assertError(assert.isObject, []); | ||
}, | ||
"`isNumber`": function (assert) { | ||
"`isNumber`": function () { | ||
assert.isNumber(0); | ||
}, | ||
"`isBoolean`": function (assert){ | ||
"`isBoolean`": function (){ | ||
assert.isBoolean(true); | ||
@@ -67,29 +65,29 @@ assert.isBoolean(false); | ||
}, | ||
"`isNan`": function (assert) { | ||
"`isNan`": function () { | ||
assert.isNaN(0/0); | ||
}, | ||
"`isTrue`": function (assert) { | ||
"`isTrue`": function () { | ||
assert.isTrue(true); | ||
assertError(assert.isTrue, 1); | ||
}, | ||
"`isFalse`": function (assert) { | ||
"`isFalse`": function () { | ||
assert.isFalse(false); | ||
assertError(assert.isFalse, 0); | ||
}, | ||
"`isZero`": function (assert) { | ||
"`isZero`": function () { | ||
assert.isZero(0); | ||
assertError(assert.isZero, null); | ||
}, | ||
"`isNotZero`": function (assert) { | ||
"`isNotZero`": function () { | ||
assert.isNotZero(1); | ||
}, | ||
"`isUndefined`": function (assert) { | ||
"`isUndefined`": function () { | ||
assert.isUndefined(undefined); | ||
assertError(assert.isUndefined, null); | ||
}, | ||
"`isDefined`": function (assert) { | ||
"`isDefined`": function () { | ||
assert.isDefined(null); | ||
assertError(assert.isDefined, undefined); | ||
}, | ||
"`isNull`": function (assert) { | ||
"`isNull`": function () { | ||
assert.isNull(null); | ||
@@ -99,10 +97,10 @@ assertError(assert.isNull, 0); | ||
}, | ||
"`isNotNull`": function (assert) { | ||
"`isNotNull`": function () { | ||
assert.isNotNull(0); | ||
}, | ||
"`greater` and `lesser`": function (assert) { | ||
"`greater` and `lesser`": function () { | ||
assert.greater(5, 4); | ||
assert.lesser(4, 5); | ||
}, | ||
"`inDelta`": function (assert) { | ||
"`inDelta`": function () { | ||
assert.inDelta(42, 40, 5); | ||
@@ -114,3 +112,3 @@ assert.inDelta(42, 40, 2); | ||
}, | ||
"`isEmpty`": function (assert) { | ||
"`isEmpty`": function () { | ||
assert.isEmpty({}); | ||
@@ -120,3 +118,3 @@ assert.isEmpty([]); | ||
}, | ||
"`isNotEmpty`": function (assert) { | ||
"`isNotEmpty`": function () { | ||
assert.isNotEmpty({goo:true}); | ||
@@ -123,0 +121,0 @@ assert.isNotEmpty([1]); |
@@ -115,3 +115,3 @@ var path = require('path'), | ||
"should pass the topics down": function (topics) { | ||
assert.length(topics, 2); | ||
assert.lengthOf(topics, 2); | ||
assert.equal(topics[0], 101); | ||
@@ -118,0 +118,0 @@ assert.equal(topics[1], 45); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96467
37
2185
47
2