mirror of
https://github.com/chaijs/chai
synced 2024-11-15 00:07:11 +00:00
Assertion#respondTo
This commit is contained in:
parent
e9169988fb
commit
c4a89f3b91
1 changed files with 9 additions and 0 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue