Move called into expect.js

This commit is contained in:
Tom Payne
2013-03-15 00:25:49 +01:00
parent 62011dab28
commit 7c7c4df3fc
3 changed files with 64 additions and 5 deletions

View File

@@ -477,6 +477,21 @@
return this;
};
/**
* Assert that a sinon spy was called.
*
* @api public
*/
Assertion.prototype.called =
Assertion.prototype.totallyWantsToSpeakToYou = function() {
this.assert(
this.obj.called
, function(){ return 'expected ' + i(this.obj) + ' to be called' }
, function(){ return 'expected ' + i(this.obj) + ' not to be called' });
return this;
};
/**
* Assert a failure.
*