Made naming somewhat less confusing

This commit is contained in:
Steve Gravrock
2018-01-10 09:00:09 -08:00
parent 4934e420b2
commit 170a6dce76
2 changed files with 24 additions and 24 deletions

View File

@@ -111,23 +111,23 @@ describe("SpyStrategy", function() {
});
it("allows a custom strategy to be used", function() {
var customStrategy = jasmine.createSpy('custom strategy')
var plan = jasmine.createSpy('custom strategy')
.and.returnValue('custom strategy result'),
factory = jasmine.createSpy('custom strategy factory')
.and.returnValue(customStrategy),
customStrategy = jasmine.createSpy('custom strategy')
.and.returnValue(plan),
originalFn = jasmine.createSpy('original'),
spyStrategy = new jasmineUnderTest.SpyStrategy({
fn: originalFn,
customStrategies: {
doSomething: factory
doSomething: customStrategy
}
});
spyStrategy.doSomething(1, 2, 3);
expect(factory).toHaveBeenCalledWith(1, 2, 3);
expect(customStrategy).toHaveBeenCalledWith(1, 2, 3);
expect(spyStrategy.exec(null, ['some', 'args']))
.toEqual('custom strategy result');
expect(customStrategy).toHaveBeenCalledWith('some', 'args');
expect(plan).toHaveBeenCalledWith('some', 'args');
});
it("throws an error if a custom strategy doesn't return a function", function() {