Comparing version 0.5.1 to 0.6.0
0.6.0 / 2012-03-01 | ||
================== | ||
* Added `err.actual` and `err.expected` for .{eql,equal}() | ||
* Added 'return this;' to 'get json' and 'get html' in order to provide chaining for should.be.json and should.be.html | ||
0.5.1 / 2012-01-13 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -35,3 +35,3 @@ /*! | ||
exports.version = '0.5.1'; | ||
exports.version = '0.6.0'; | ||
@@ -116,11 +116,15 @@ /** | ||
* @param {String} negatedMsg | ||
* @param {Object} expected | ||
* @api private | ||
*/ | ||
assert: function(expr, msg, negatedMsg){ | ||
assert: function(expr, msg, negatedMsg, expected){ | ||
var msg = this.negate ? negatedMsg : msg | ||
, ok = this.negate ? !expr : expr; | ||
if (!ok) { | ||
throw new AssertionError({ | ||
message: msg | ||
, actual: this.obj | ||
, expected: expected | ||
, stackStartFunction: this.assert | ||
@@ -286,3 +290,4 @@ }); | ||
, 'expected ' + this.inspect + ' to equal ' + i(val) + (desc ? " | " + desc : "") | ||
, 'expected ' + this.inspect + ' to not equal ' + i(val) + (desc ? " | " + desc : "")); | ||
, 'expected ' + this.inspect + ' to not equal ' + i(val) + (desc ? " | " + desc : "") | ||
, val); | ||
return this; | ||
@@ -303,3 +308,4 @@ }, | ||
, 'expected ' + this.inspect + ' to equal ' + i(val) + (desc ? " | " + desc : "") | ||
, 'expected ' + this.inspect + ' to not equal ' + i(val) + (desc ? " | " + desc : "")); | ||
, 'expected ' + this.inspect + ' to not equal ' + i(val) + (desc ? " | " + desc : "") | ||
, val); | ||
return this; | ||
@@ -623,2 +629,3 @@ }, | ||
this.obj.headers['content-type'].should.include('application/json'); | ||
return this; | ||
}, | ||
@@ -637,2 +644,3 @@ | ||
this.obj.headers['content-type'].should.include('text/html'); | ||
return this; | ||
}, | ||
@@ -639,0 +647,0 @@ |
{ "name": "should" | ||
, "description": "test framework agnostic BDD-style assertions" | ||
, "version": "0.5.1" | ||
, "version": "0.6.0" | ||
, "author": "TJ Holowaychuk <tj@vision-media.ca>" | ||
@@ -5,0 +5,0 @@ , "contributors": [ "Aseem Kishore <aseem.kishore@gmail.com>" ] |
@@ -6,3 +6,4 @@ | ||
var should = require('../'); | ||
var should = require('../') | ||
, assert = require('assert'); | ||
@@ -66,3 +67,12 @@ function err(fn, msg) { | ||
}, | ||
'test .expected and .actual': function(){ | ||
try { | ||
'foo'.should.equal('bar'); | ||
} catch (err) { | ||
assert('foo' == err.actual, 'err.actual'); | ||
assert('bar' == err.expected, 'err.expected'); | ||
} | ||
}, | ||
'test arguments': function(){ | ||
@@ -69,0 +79,0 @@ var args = (function(){ return arguments; })(1,2,3); |
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
48793
1209