Move intersect into expect.js

This commit is contained in:
Tom Payne
2013-03-15 00:37:05 +01:00
parent 7c7c4df3fc
commit 79c77a6369
3 changed files with 45 additions and 33 deletions
+17
View File
@@ -492,6 +492,23 @@
return this;
};
/**
* Assert that that objects intersect.
* FIXME this is ol3 specific
*
* @param {Object} other
*
* @api public
*/
Assertion.prototype.intersect =
Assertion.prototype.wentToSchoolWith = function(other) {
this.assert(
this.obj.intersects(other)
, function(){ return 'expected ' + i(this.obj) + ' to intersect ' + i(other) }
, function(){ return 'expected ' + i(this.obj) + ' not to intersect ' + i(other) });
return this;
};
/**
* Assert a failure.
*