Squashed spy refactor and new spy syntax
Jasmine spies now have a 'and' property which allows the user to change the spy's execution strategy-- such as '.and.callReturn(4)' and a 'calls' property which allows inspection of the calls a spy has received. * This is a breaking change * There is a CallTracker that keeps track of all calls and arguments and a SpyStrategy which determines what the spy should do when it is called.
This commit is contained in:
committed by
Colin O'Byrne and JR Boyens
parent
18c30566bd
commit
3847557bbc
@@ -1,7 +1,7 @@
|
||||
describe("toEqual", function() {
|
||||
it("delegates to equals function", function() {
|
||||
var util = {
|
||||
equals: jasmine.createSpy('delegated-equals').andReturn(true)
|
||||
equals: jasmine.createSpy('delegated-equals').and.callReturn(true)
|
||||
},
|
||||
matcher = j$.matchers.toEqual(util),
|
||||
result;
|
||||
@@ -14,7 +14,7 @@ describe("toEqual", function() {
|
||||
|
||||
it("delegates custom equality testers, if present", function() {
|
||||
var util = {
|
||||
equals: jasmine.createSpy('delegated-equals').andReturn(true)
|
||||
equals: jasmine.createSpy('delegated-equals').and.callReturn(true)
|
||||
},
|
||||
customEqualityTesters = ['a', 'b'],
|
||||
matcher = j$.matchers.toEqual(util, customEqualityTesters),
|
||||
|
||||
Reference in New Issue
Block a user