Setup createSpy in all specs where needed and finish renaming params
Signed-off-by: Elenore Bastian <ebastian@pivotal.io>
This commit is contained in:
committed by
Elenore Bastian
parent
038ab87252
commit
414e03bded
@@ -4958,7 +4958,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
|
|||||||
* @param {Function} factory - Factory function that returns the plan to be executed.
|
* @param {Function} factory - Factory function that returns the plan to be executed.
|
||||||
*/
|
*/
|
||||||
jasmine.addSpyStrategy = function(name, factory) {
|
jasmine.addSpyStrategy = function(name, factory) {
|
||||||
return env.addSpyStrategy(identifier, factory);
|
return env.addSpyStrategy(name, factory);
|
||||||
};
|
};
|
||||||
|
|
||||||
return jasmineInterface;
|
return jasmineInterface;
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ describe("SpyRegistry", function() {
|
|||||||
global = new FakeWindow(),
|
global = new FakeWindow(),
|
||||||
spyRegistry = new jasmineUnderTest.SpyRegistry({
|
spyRegistry = new jasmineUnderTest.SpyRegistry({
|
||||||
currentSpies: function() { return spies; },
|
currentSpies: function() { return spies; },
|
||||||
|
createSpy: createSpy,
|
||||||
global: global
|
global: global
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
describe('Spy Registry browser-specific behavior', function() {
|
describe('Spy Registry browser-specific behavior', function() {
|
||||||
|
function createSpy(name, originalFn) {
|
||||||
|
return jasmineUnderTest.Spy(name, originalFn);
|
||||||
|
}
|
||||||
|
|
||||||
it('can spy on and unspy window.onerror', function() {
|
it('can spy on and unspy window.onerror', function() {
|
||||||
requireWriteableOnerror();
|
requireWriteableOnerror();
|
||||||
|
|
||||||
var spies = [],
|
var spies = [],
|
||||||
spyRegistry = new jasmineUnderTest.SpyRegistry({
|
spyRegistry = new jasmineUnderTest.SpyRegistry({
|
||||||
currentSpies: function() { return spies; },
|
currentSpies: function() { return spies; },
|
||||||
global: window
|
createSpy: createSpy,
|
||||||
}),
|
global: window
|
||||||
|
}),
|
||||||
originalHandler = window.onerror;
|
originalHandler = window.onerror;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
|
|||||||
* @param {Function} factory - Factory function that returns the plan to be executed.
|
* @param {Function} factory - Factory function that returns the plan to be executed.
|
||||||
*/
|
*/
|
||||||
jasmine.addSpyStrategy = function(name, factory) {
|
jasmine.addSpyStrategy = function(name, factory) {
|
||||||
return env.addSpyStrategy(identifier, factory);
|
return env.addSpyStrategy(name, factory);
|
||||||
};
|
};
|
||||||
|
|
||||||
return jasmineInterface;
|
return jasmineInterface;
|
||||||
|
|||||||
Reference in New Issue
Block a user