Assertion#respondTo

This commit is contained in:
Jake Luer 2011-12-15 05:32:09 -05:00
parent e9169988fb
commit c4a89f3b91

View file

@ -161,6 +161,15 @@ Assertion.prototype.instanceof = function (constructor) {
return this;
};
Assertion.prototype.respondTo = function (method) {
this.assert(
'function' == typeof this.obj[method]
, 'expected ' + this.inspect + ' to respond to ' + method + '()'
, 'expected ' + this.inspect + ' to not respond to ' + method + '()');
return this;
}
Assertion.prototype.property = function (name, val) {
if (val) {
this.assert(