Remove 'actual' param from matchers test and message functions. Use this.actual instead. This way, the signature of the test function matches how the matcher is called from a spec.
Spy matchers now throw an exception when called with non-spies, rather than returning false. This makes the message function simpler, and will work better with future dot-not support. Added better specs for error conditions on spy matchers.
This commit is contained in:
10
src/base.js
10
src/base.js
@@ -324,6 +324,16 @@ jasmine.createSpy = function(name) {
|
||||
return spyObj;
|
||||
};
|
||||
|
||||
/**
|
||||
* Determines whether an object is a spy.
|
||||
*
|
||||
* @param {jasmine.Spy|Object} putativeSpy
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
jasmine.isSpy = function(putativeSpy) {
|
||||
return putativeSpy && putativeSpy.isSpy;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something
|
||||
* large in one call.
|
||||
|
||||
Reference in New Issue
Block a user