Skip to content

Commit

Permalink
Whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaefferer committed Dec 1, 2011
1 parent fa23d1e commit 4f380cb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
26 changes: 13 additions & 13 deletions jquery.mockjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
DOMParser = function() { };
DOMParser.prototype.parseFromString = function( xmlString ) {
var doc = new ActiveXObject('Microsoft.XMLDOM');
doc.async = 'false';
doc.loadXML( xmlString );
doc.async = 'false';
doc.loadXML( xmlString );
return doc;
};
}
Expand Down Expand Up @@ -55,7 +55,7 @@
origSettings.url = url;
}
var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
mock = false;
mock = false;
// Iterate over our mock handlers (in registration order) until we find
// one that is willing to intercept the request
$.each(mockHandlers, function(k, v) {
Expand Down Expand Up @@ -234,12 +234,12 @@
complete();
return false;
}

m.data = s.data;
m.cache = s.cache;
m.timeout = s.timeout;
m.global = s.global;

mock = _ajax.call($, $.extend(true, {}, origSettings, {
// Mock the XHR object
xhr: function() {
Expand All @@ -259,15 +259,15 @@
readyState: 1,
open: function() { },
send: function() {

mockHandlers[k].fired = true;

// This is a substitute for < 1.4 which lacks $.proxy
var process = (function(that) {
return function() {
return (function() {
// The request has returned
this.status = m.status;
this.status = m.status;
this.readyState = 4;

// We have an executable function, call it to give
Expand All @@ -288,9 +288,9 @@
} else {
this.responseText = m.responseText;
}
if( typeof m.status == 'number' || typeof m.status == 'string' ) {
this.status = m.status;
}
if( typeof m.status == 'number' || typeof m.status == 'string' ) {
this.status = m.status;
}
// jQuery < 1.4 doesn't have onreadystate change for xhr
if ( $.isFunction(this.onreadystatechange) ) {
this.onreadystatechange( m.isTimeout ? 'timeout' : undefined );
Expand Down Expand Up @@ -369,8 +369,8 @@
//url: null,
//type: 'GET',
log: function(msg) {
window['console'] && window.console.log && window.console.log(msg);
},
window['console'] && window.console.log && window.console.log(msg);
},
status: 200,
responseTime: 500,
isTimeout: false,
Expand Down
16 changes: 8 additions & 8 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,14 @@ test('Inspecting $.mockjax.handler(id) after request has fired', function() {
url: '/mockjax_properties',
responseText: "Hello Word"
});

var xhr = $.ajax({
url: '/mockjax_properties',
complete: function() {}
});

ok($.mockjax.handler(ID).fired, "Sets the mock's fired property to true");

$.mockjaxClear();
});

Expand All @@ -211,7 +211,7 @@ asyncTest('Inspecting $.mockjax.handler\'s data after request has fired', functi
url: '/mockjax_data_properties',
responseText: "Hello Word"
});

var xhr = $.ajax({
url: '/mockjax_data_properties',
data: {
Expand All @@ -225,9 +225,9 @@ asyncTest('Inspecting $.mockjax.handler\'s data after request has fired', functi
start();
}
});

ok($.mockjax.handler(ID).fired, "Sets the mock's fired property to true");

});

module('Type Matching');
Expand All @@ -237,7 +237,7 @@ asyncTest('Case-insensitive matching for request types', function() {
type: 'GET',
responseText: 'uppercase type response'
});

$.ajax({
url: '/case_insensitive_match',
type: 'get',
Expand All @@ -247,7 +247,7 @@ asyncTest('Case-insensitive matching for request types', function() {
start();
}
});

$.mockjaxClear();
});

Expand Down

0 comments on commit 4f380cb

Please sign in to comment.