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
@@ -16,7 +16,7 @@ describe("buildExpectationResult", function() {
|
||||
|
||||
it("delegates message formatting to the provided formatter if there was an Error", function() {
|
||||
var fakeError = {message: 'foo'},
|
||||
messageFormatter = jasmine.createSpy("exception message formatter").andReturn(fakeError.message);
|
||||
messageFormatter = jasmine.createSpy("exception message formatter").and.callReturn(fakeError.message);
|
||||
|
||||
var result = j$.buildExpectationResult(
|
||||
{
|
||||
@@ -31,7 +31,7 @@ describe("buildExpectationResult", function() {
|
||||
|
||||
it("delegates stack formatting to the provided formatter if there was an Error", function() {
|
||||
var fakeError = {stack: 'foo'},
|
||||
stackFormatter = jasmine.createSpy("stack formatter").andReturn(fakeError.stack);
|
||||
stackFormatter = jasmine.createSpy("stack formatter").and.callReturn(fakeError.stack);
|
||||
|
||||
var result = j$.buildExpectationResult(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user