Add Assertion#arreql

Needed because expect.js's eql does not support typed arrays.
This commit is contained in:
Tom Payne
2013-05-31 16:52:09 +02:00
parent 3225a07f6f
commit 38c0e24bcd

View File

@@ -371,6 +371,20 @@
return this;
};
/**
* Checks if the array sort of equals another array.
*
* @api public
*/
Assertion.prototype.arreql = function (obj) {
this.assert(
goog.array.equals(this.obj, obj)
, function(){ return 'expected ' + i(this.obj) + ' to sort of equal ' + i(obj) }
, function(){ return 'expected ' + i(this.obj) + ' to sort of not equal ' + i(obj) });
return this;
};
/**
* Checks if the obj sortof equals another.
*