Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX Passing through ignoreMethodDoesntExist parameter in jasmine.j…

…s, so we can use it in jasmine-ajax and avoid "xhr has already been spied upon" errors when executing tests through JSTestDriver (submitted patch to both projects)
  • Loading branch information...
commit 99099e88382ad22cffd9038058bdf82da6cb99fb 1 parent 7bda1ec
@chillu chillu authored
View
4 thirdparty/jasmine-ajax/lib/spec-helper.js
@@ -1,7 +1,7 @@
beforeEach(function() {
if (typeof jQuery != 'undefined') {
- spyOn(jQuery.ajaxSettings, 'xhr').andCallFake(function() {
+ spyOn(jQuery.ajaxSettings, 'xhr', true).andCallFake(function() {
var newXhr = new FakeXMLHttpRequest();
ajaxRequests.push(newXhr);
return newXhr;
@@ -9,7 +9,7 @@ beforeEach(function() {
}
if (typeof Prototype != 'undefined') {
- spyOn(Ajax, "getTransport").andCallFake(function() {
+ spyOn(Ajax, "getTransport", true).andCallFake(function() {
return new FakeXMLHttpRequest();
});
}
View
4 thirdparty/jasmine/lib/jasmine.js
@@ -440,8 +440,8 @@ jasmine.log = function() {
* @param methodName
* @returns a Jasmine spy that can be chained with all spy methods
*/
-var spyOn = function(obj, methodName) {
- return jasmine.getEnv().currentSpec.spyOn(obj, methodName);
+var spyOn = function(obj, methodName, ignoreMethodDoesntExist) {
+ return jasmine.getEnv().currentSpec.spyOn(obj, methodName, ignoreMethodDoesntExist);
};
/**
Please sign in to comment.
Something went wrong with that request. Please try again.