aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/csp.php4
-rw-r--r--test/data/etag.php4
-rw-r--r--test/data/event/asyncReady.html4
-rw-r--r--test/data/if_modified_since.php4
-rw-r--r--test/data/iframe.html12
-rw-r--r--test/delegatetest.html54
-rw-r--r--test/hovertest.html52
-rw-r--r--test/polluted.php2
-rw-r--r--test/unit/ajax.js190
-rw-r--r--test/unit/core.js104
10 files changed, 215 insertions, 215 deletions
diff --git a/test/csp.php b/test/csp.php
index 46cba8348..3a029eb42 100644
--- a/test/csp.php
+++ b/test/csp.php
@@ -2,10 +2,10 @@
<!DOCTYPE html>
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSP Test Page</title>
- <script src="data/include_js.php"></script>
+ <script src="data/include_js.php"></script>
</head>
<body>
<p>CSP Test Page</p>
diff --git a/test/data/etag.php b/test/data/etag.php
index 7bcfcd1e6..f6abc26e4 100644
--- a/test/data/etag.php
+++ b/test/data/etag.php
@@ -6,8 +6,8 @@ $etag = md5($ts);
$ifNoneMatch = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : false;
if ($ifNoneMatch == $etag) {
- header('HTTP/1.0 304 Not Modified');
- die; // stop processing
+ header('HTTP/1.0 304 Not Modified');
+ die; // stop processing
}
header("Etag: " . $etag);
diff --git a/test/data/event/asyncReady.html b/test/data/event/asyncReady.html
index 0b389d854..1d18efc17 100644
--- a/test/data/event/asyncReady.html
+++ b/test/data/event/asyncReady.html
@@ -17,7 +17,7 @@ if ( document.attachEvent ) {
jQuery("body").append("<div>modifying DOM</div>");
window.parent.iframeCallback( true );
});
- }
+ }
document.getElementsByTagName("head")[ 0 ].appendChild( el );
el.src = "../include_js.php";
}, 1000 );
@@ -28,4 +28,4 @@ if ( document.attachEvent ) {
<!-- long loading iframe -->
<iframe src="longLoad.php?sleep=15&return=false" style="width: 1px; height: 1px"></iframe>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/test/data/if_modified_since.php b/test/data/if_modified_since.php
index e37a93e57..098b7da85 100644
--- a/test/data/if_modified_since.php
+++ b/test/data/if_modified_since.php
@@ -5,8 +5,8 @@ $ts = $_REQUEST['ts'];
$ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false;
if ($ifModifiedSince == $ts) {
- header('HTTP/1.0 304 Not Modified');
- die; // stop processing
+ header('HTTP/1.0 304 Not Modified');
+ die; // stop processing
}
header("Last-Modified: " . $ts);
diff --git a/test/data/iframe.html b/test/data/iframe.html
index 3ff26e161..ad646c430 100644
--- a/test/data/iframe.html
+++ b/test/data/iframe.html
@@ -1,8 +1,8 @@
<html>
- <head>
- <title>iframe</title>
- </head>
- <body>
- <div><span>span text</span></div>
- </body>
+ <head>
+ <title>iframe</title>
+ </head>
+ <body>
+ <div><span>span text</span></div>
+ </body>
</html>
diff --git a/test/delegatetest.html b/test/delegatetest.html
index a291763b2..b16771d3d 100644
--- a/test/delegatetest.html
+++ b/test/delegatetest.html
@@ -89,37 +89,37 @@ th, td {
</table>
<p>NOTE: Only IE supports propertychange, beforeactivate, beforedeactivate; buttons do not support change events.</p>
- <h2>Submit Tests</h2>
- <table>
+<h2>Submit Tests</h2>
+<table>
<tr>
- <td>
- Submit each:
- </td>
- <td>
- <form action="" id="text_submit">
- <input class='test' type='text' value='Key Return To Submit'/>
- </form>
- </td>
- <td>
- <form action="" id="password_submit">
- <input class='test' type='password' value=''/>
- </form>
- </td>
- <td>
- <form action="" id="submit_submit">
- <input type='submit' value="Click Me To Submit" />
- </form>
- </td>
- <td>$(document).bind('submit')</td>
+ <td>
+ Submit each:
+ </td>
+ <td>
+ <form action="" id="text_submit">
+ <input class='test' type='text' value='Key Return To Submit'/>
+ </form>
+ </td>
+ <td>
+ <form action="" id="password_submit">
+ <input class='test' type='password' value=''/>
+ </form>
+ </td>
+ <td>
+ <form action="" id="submit_submit">
+ <input type='submit' value="Click Me To Submit" />
+ </form>
+ </td>
+ <td>$(document).bind('submit')</td>
</tr>
<tr>
- <td>Results:</td>
- <td id='textSubmit' class="red">TEXT</td>
- <td id='passwordSubmit' class="red">PASSWORD</td>
- <td id='submitSubmit' class="red">BUTTON</td>
- <td id='boundSubmit' class="red">DOCUMENT</td>
+ <td>Results:</td>
+ <td id='textSubmit' class="red">TEXT</td>
+ <td id='passwordSubmit' class="red">PASSWORD</td>
+ <td id='submitSubmit' class="red">BUTTON</td>
+ <td id='boundSubmit' class="red">DOCUMENT</td>
</tr>
- </table>
+</table>
<form id="autosub"><input type=submit name=subme /></form>
diff --git a/test/hovertest.html b/test/hovertest.html
index 2d2736a65..a0efd9f4f 100644
--- a/test/hovertest.html
+++ b/test/hovertest.html
@@ -31,64 +31,64 @@ p {
</style>
</head>
<body>
- <h2>Hover (mouse{over,out,enter,leave}) Tests</h2>
+ <h2>Hover (mouse{over,out,enter,leave}) Tests</h2>
<p>Be sure to try moving the mouse out of the browser via the left side on each test.</p>
<div id="wrapper">
-
+
<div id="hoverbox" class="hover-box">
- <div class="hover-status">
+ <div class="hover-status">
<button>Activate</button>
.hover() in/out: <span class="ins">0</span> / <span class="outs">0</span>
</div>
- <div class="hover-inside">
- Mouse over here should NOT trigger the counter.
- </div>
+ <div class="hover-inside">
+ Mouse over here should NOT trigger the counter.
+ </div>
</div>
<div id="liveenterbox" class="hover-box">
- <div class="hover-status">
+ <div class="hover-status">
<button>Activate</button>
Live enter/leave: <span class="ins">0</span> / <span class="outs">0</span>
</div>
- <div class="hover-inside">
- Mouse over here should NOT trigger the counter.
- </div>
+ <div class="hover-inside">
+ Mouse over here should NOT trigger the counter.
+ </div>
</div>
<div id="delegateenterbox" class="hover-box">
- <div class="hover-status">
+ <div class="hover-status">
<button>Activate</button>
Delegated enter/leave: <span class="ins">0</span> / <span class="outs">0</span>
</div>
- <div class="hover-inside">
- Mouse over here should NOT trigger the counter.
- </div>
+ <div class="hover-inside">
+ Mouse over here should NOT trigger the counter.
+ </div>
</div>
<div id="overbox" class="hover-box">
- <div class="hover-status">
+ <div class="hover-status">
<button>Activate</button>
Bind over/out: <span class="ins">0</span> / <span class="outs">0</span>
</div>
- <div class="hover-inside">
- Mouse over here SHOULD trigger the counter.
- </div>
+ <div class="hover-inside">
+ Mouse over here SHOULD trigger the counter.
+ </div>
</div>
<div id="liveoverbox" class="hover-box">
- <div class="hover-status">
+ <div class="hover-status">
<button>Activate</button>
Live over/out: <span class="ins">0</span> / <span class="outs">0</span>
</div>
- <div class="hover-inside">
- Mouse over here SHOULD trigger the counter.
- </div>
+ <div class="hover-inside">
+ Mouse over here SHOULD trigger the counter.
+ </div>
</div>
<div id="delegateoverbox" class="hover-box">
- <div class="hover-status">
+ <div class="hover-status">
<button>Activate</button>
Delegated over/out: <span class="ins">0</span> / <span class="outs">0</span>
</div>
- <div class="hover-inside">
- Mouse over here SHOULD trigger the counter.
- </div>
+ <div class="hover-inside">
+ Mouse over here SHOULD trigger the counter.
+ </div>
</div>
</div> <!-- wrapper -->
diff --git a/test/polluted.php b/test/polluted.php
index 50fc7cd68..54b52d20d 100644
--- a/test/polluted.php
+++ b/test/polluted.php
@@ -63,7 +63,7 @@
<!DOCTYPE html>
<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Run jQuery Test Suite Polluted</title>
<style type="text/css">
.otherlibs fieldset {
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index d9c4c33e7..62677697b 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -769,8 +769,8 @@ test("jQuery.ajax() - disabled globals", function() {
success: function(){ ok(true, "success"); },
error: function(){ ok(false, "error"); },
complete: function(){
- ok(true, "complete");
- setTimeout(function(){ start(); }, 13);
+ ok(true, "complete");
+ setTimeout(function(){ start(); }, 13);
}
});
});
@@ -779,14 +779,14 @@ test("jQuery.ajax - xml: non-namespace elements inside namespaced elements", fun
expect(3);
stop();
jQuery.ajax({
- url: url("data/with_fries.xml"),
- dataType: "xml",
- success: function(resp) {
- equal( jQuery("properties", resp).length, 1, "properties in responseXML" );
- equal( jQuery("jsconf", resp).length, 1, "jsconf in responseXML" );
- equal( jQuery("thing", resp).length, 2, "things in responseXML" );
- start();
- }
+ url: url("data/with_fries.xml"),
+ dataType: "xml",
+ success: function(resp) {
+ equal( jQuery("properties", resp).length, 1, "properties in responseXML" );
+ equal( jQuery("jsconf", resp).length, 1, "jsconf in responseXML" );
+ equal( jQuery("thing", resp).length, 2, "things in responseXML" );
+ start();
+ }
});
});
@@ -794,18 +794,18 @@ test("jQuery.ajax - xml: non-namespace elements inside namespaced elements (over
expect(3);
stop();
jQuery.ajax({
- url: url("data/with_fries_over_jsonp.php"),
- dataType: "jsonp xml",
- success: function(resp) {
- equal( jQuery("properties", resp).length, 1, "properties in responseXML" );
- equal( jQuery("jsconf", resp).length, 1, "jsconf in responseXML" );
- equal( jQuery("thing", resp).length, 2, "things in responseXML" );
- start();
- },
- error: function(_1,_2,error) {
- ok( false, error );
- start();
- }
+ url: url("data/with_fries_over_jsonp.php"),
+ dataType: "jsonp xml",
+ success: function(resp) {
+ equal( jQuery("properties", resp).length, 1, "properties in responseXML" );
+ equal( jQuery("jsconf", resp).length, 1, "jsconf in responseXML" );
+ equal( jQuery("thing", resp).length, 2, "things in responseXML" );
+ start();
+ },
+ error: function(_1,_2,error) {
+ ok( false, error );
+ start();
+ }
});
});
@@ -914,13 +914,13 @@ test("jQuery.ajax - dataType html", function() {
};
jQuery.ajax({
- dataType: "html",
- url: url("data/test.html"),
- success: function(data) {
- jQuery("#ap").html(data);
- ok( data.match(/^html text/), "Check content for datatype html" );
- setTimeout(verifyEvaluation, 600);
- }
+ dataType: "html",
+ url: url("data/test.html"),
+ success: function(data) {
+ jQuery("#ap").html(data);
+ ok( data.match(/^html text/), "Check content for datatype html" );
+ setTimeout(verifyEvaluation, 600);
+ }
});
});
@@ -953,7 +953,7 @@ test("serialize()", function() {
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
"Multiple form serialization as query string");
- /* Temporarily disabled. Opera 10 has problems with form serialization.
+ /* Temporarily disabled. Opera 10 has problems with form serialization.
equal( jQuery("#form, #testForm :input").serialize(),
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
"Mixed form/input serialization as query string");
@@ -1741,7 +1741,7 @@ test("jQuery.ajax() - malformed JSON", function() {
error: function(xhr, msg, detailedMsg) {
equal( "parsererror", msg, "A parse error occurred." );
ok( /(invalid|error|exception)/i.test(detailedMsg), "Detailed parsererror message provided" );
- start();
+ start();
}
});
});
@@ -1777,12 +1777,12 @@ test("jQuery.ajax() - json by content-type", function() {
url: "data/json.php",
data: { header: "json", json: "array" },
success: function( json ) {
- ok( json.length >= 2, "Check length");
- equal( json[0].name, "John", "Check JSON: first, name" );
- equal( json[0].age, 21, "Check JSON: first, age" );
- equal( json[1].name, "Peter", "Check JSON: second, name" );
- equal( json[1].age, 25, "Check JSON: second, age" );
- start();
+ ok( json.length >= 2, "Check length");
+ equal( json[0].name, "John", "Check JSON: first, name" );
+ equal( json[0].age, 21, "Check JSON: first, age" );
+ equal( json[1].name, "Peter", "Check JSON: second, name" );
+ equal( json[1].age, 25, "Check JSON: second, age" );
+ start();
}
});
});
@@ -1801,12 +1801,12 @@ test("jQuery.ajax() - json by content-type disabled with options", function() {
success: function( text ) {
equal( typeof text , "string" , "json wasn't auto-determined" );
var json = jQuery.parseJSON( text );
- ok( json.length >= 2, "Check length");
- equal( json[0].name, "John", "Check JSON: first, name" );
- equal( json[0].age, 21, "Check JSON: first, age" );
- equal( json[1].name, "Peter", "Check JSON: second, name" );
- equal( json[1].age, 25, "Check JSON: second, age" );
- start();
+ ok( json.length >= 2, "Check length");
+ equal( json[0].name, "John", "Check JSON: first, name" );
+ equal( json[0].age, 21, "Check JSON: first, age" );
+ equal( json[1].name, "Peter", "Check JSON: second, name" );
+ equal( json[1].age, 25, "Check JSON: second, age" );
+ start();
}
});
});
@@ -1815,12 +1815,12 @@ test("jQuery.getJSON(String, Hash, Function) - JSON array", function() {
expect(5);
stop();
jQuery.getJSON(url("data/json.php"), {json: "array"}, function(json) {
- ok( json.length >= 2, "Check length");
- equal( json[0].name, "John", "Check JSON: first, name" );
- equal( json[0].age, 21, "Check JSON: first, age" );
- equal( json[1].name, "Peter", "Check JSON: second, name" );
- equal( json[1].age, 25, "Check JSON: second, age" );
- start();
+ ok( json.length >= 2, "Check length");
+ equal( json[0].name, "John", "Check JSON: first, name" );
+ equal( json[0].age, 21, "Check JSON: first, age" );
+ equal( json[1].name, "Peter", "Check JSON: second, name" );
+ equal( json[1].age, 25, "Check JSON: second, age" );
+ start();
});
});
@@ -1828,11 +1828,11 @@ test("jQuery.getJSON(String, Function) - JSON object", function() {
expect(2);
stop();
jQuery.getJSON(url("data/json.php"), function(json) {
- if (json && json.data) {
- equal( json.data.lang, "en", "Check JSON: lang" );
- equal( json.data.length, 25, "Check JSON: length" );
- }
- start();
+ if (json && json.data) {
+ equal( json.data.lang, "en", "Check JSON: lang" );
+ equal( json.data.length, 25, "Check JSON: length" );
+ }
+ start();
});
});
@@ -1862,9 +1862,9 @@ test("jQuery.getJSON(String, Function) - JSON object with absolute url to local
stop();
jQuery.getJSON(url(base + "data/json.php"), function(json) {
- equal( json.data.lang, "en", "Check JSON: lang" );
- equal( json.data.length, 25, "Check JSON: length" );
- start();
+ equal( json.data.lang, "en", "Check JSON: lang" );
+ equal( json.data.length, 25, "Check JSON: length" );
+ start();
});
});
@@ -1904,19 +1904,19 @@ test("jQuery.post(String, Hash, Function) - simple with xml", function() {
var done = 0;
jQuery.post(url("data/name.php"), {xml: "5-2"}, function(xml){
- jQuery("math", xml).each(function() {
+ jQuery("math", xml).each(function() {
equal( jQuery("calculation", this).text(), "5-2", "Check for XML" );
equal( jQuery("result", this).text(), "3", "Check for XML" );
- });
- if ( ++done === 2 ) start();
+ });
+ if ( ++done === 2 ) start();
});
jQuery.post(url("data/name.php?xml=5-2"), {}, function(xml){
- jQuery("math", xml).each(function() {
+ jQuery("math", xml).each(function() {
equal( jQuery("calculation", this).text(), "5-2", "Check for XML" );
equal( jQuery("result", this).text(), "3", "Check for XML" );
- });
- if ( ++done === 2 ) start();
+ });
+ if ( ++done === 2 ) start();
});
});
@@ -1944,10 +1944,10 @@ test("jQuery.ajaxSetup({timeout: Number}) - with global timeout", function() {
jQuery("#qunit-fixture").ajaxError(pass);
jQuery.ajax({
- type: "GET",
- url: url("data/name.php?wait=5"),
- error: pass,
- success: fail
+ type: "GET",
+ url: url("data/name.php?wait=5"),
+ error: pass,
+ success: fail
});
// reset timeout
@@ -1959,17 +1959,17 @@ test("jQuery.ajaxSetup({timeout: Number}) with localtimeout", function() {
jQuery.ajaxSetup({timeout: 50});
jQuery.ajax({
- type: "GET",
- timeout: 15000,
- url: url("data/name.php?wait=1"),
- error: function() {
- ok( false, "Check for local timeout failed" );
- start();
- },
- success: function() {
- ok( true, "Check for local timeout" );
- start();
- }
+ type: "GET",
+ timeout: 15000,
+ url: url("data/name.php?wait=1"),
+ error: function() {
+ ok( false, "Check for local timeout failed" );
+ start();
+ },
+ success: function() {
+ ok( true, "Check for local timeout" );
+ start();
+ }
});
// reset timeout
@@ -1980,12 +1980,12 @@ test("jQuery.ajax - simple get", function() {
expect(1);
stop();
jQuery.ajax({
- type: "GET",
- url: url("data/name.php?name=foo"),
- success: function(msg){
- equal( msg, "bar", "Check for GET" );
- start();
- }
+ type: "GET",
+ url: url("data/name.php?name=foo"),
+ success: function(msg){
+ equal( msg, "bar", "Check for GET" );
+ start();
+ }
});
});
@@ -1993,13 +1993,13 @@ test("jQuery.ajax - simple post", function() {
expect(1);
stop();
jQuery.ajax({
- type: "POST",
- url: url("data/name.php"),
- data: "name=peter",
- success: function(msg){
- equal( msg, "pan", "Check for POST" );
- start();
- }
+ type: "POST",
+ url: url("data/name.php"),
+ data: "name=peter",
+ success: function(msg){
+ equal( msg, "pan", "Check for POST" );
+ start();
+ }
});
});
@@ -2091,7 +2091,7 @@ jQuery.each( { " (cache)": true, " (no cache)": false }, function( label, cache
ok(data == null, "response body should be empty");
}
start();
- },
+ },
error: function() {
// Do this because opera simply refuses to implement 304 handling :(
// A feature-driven way of detecting this would be appreciated
@@ -2140,8 +2140,8 @@ jQuery.each( { " (cache)": true, " (no cache)": false }, function( label, cache
ok(data == null, "response body should be empty");
}
start();
- },
- error: function() {
+ },
+ error: function() {
// Do this because opera simply refuses to implement 304 handling :(
// A feature-driven way of detecting this would be appreciated
// See: http://gist.github.com/599419
@@ -2476,7 +2476,7 @@ test( "jQuery.domManip - script in comments are properly evaluated (#11402)", fu
});
test("jQuery.ajax - active counter", function() {
- ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
+ ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
});
}
diff --git a/test/unit/core.js b/test/unit/core.js
index 94f985db6..4605795b4 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -1064,13 +1064,13 @@ test("jQuery.proxy", function(){
// Make sure it doesn't freak out
equal( jQuery.proxy( null, thisObject ), undefined, "Make sure no function was returned." );
- // Partial application
- var test2 = function( a ){ equal( a, "pre-applied", "Ensure arguments can be pre-applied." ); };
- jQuery.proxy( test2, null, "pre-applied" )();
+ // Partial application
+ var test2 = function( a ){ equal( a, "pre-applied", "Ensure arguments can be pre-applied." ); };
+ jQuery.proxy( test2, null, "pre-applied" )();
- // Partial application w/ normal arguments
- var test3 = function( a, b ){ equal( b, "normal", "Ensure arguments can be pre-applied and passed as usual." ); };
- jQuery.proxy( test3, null, "pre-applied" )( "normal" );
+ // Partial application w/ normal arguments
+ var test3 = function( a, b ){ equal( b, "normal", "Ensure arguments can be pre-applied and passed as usual." ); };
+ jQuery.proxy( test3, null, "pre-applied" )( "normal" );
// Test old syntax
var test4 = { meth: function( a ){ equal( a, "boom", "Ensure old syntax works." ); } };
@@ -1137,52 +1137,52 @@ test("jQuery.parseXML", 8, function(){
});
test("jQuery.sub() - Static Methods", function(){
- expect(18);
- var Subclass = jQuery.sub();
- Subclass.extend({
- topLevelMethod: function() {return this.debug;},
- debug: false,
- config: {
- locale: "en_US"
- },
- setup: function(config) {
- this.extend(true, this.config, config);
- }
- });
- Subclass.fn.extend({subClassMethod: function() { return this;}});
-
- //Test Simple Subclass
- ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true");
- ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!");
- deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly");
- equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");
-
- //Create a SubSubclass
- var SubSubclass = Subclass.sub();
-
- //Make Sure the SubSubclass inherited properly
- ok(SubSubclass.topLevelMethod() === false, "SubSubclass.topLevelMethod thought debug was true");
- ok(SubSubclass.config.locale == "en_US", SubSubclass.config.locale + " is wrong!");
- deepEqual(SubSubclass.config.test, undefined, "SubSubclass.config.test is set incorrectly");
- equal(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");
-
- //Modify The Subclass and test the Modifications
- SubSubclass.fn.extend({subSubClassMethod: function() { return this;}});
- SubSubclass.setup({locale: "es_MX", test: "worked"});
- SubSubclass.debug = true;
- SubSubclass.ajax = function() {return false;};
- ok(SubSubclass.topLevelMethod(), "SubSubclass.topLevelMethod thought debug was false");
- deepEqual(SubSubclass(document).subClassMethod, Subclass.fn.subClassMethod, "Methods Differ!");
- ok(SubSubclass.config.locale == "es_MX", SubSubclass.config.locale + " is wrong!");
- ok(SubSubclass.config.test == "worked", "SubSubclass.config.test is set incorrectly");
- notEqual(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");
-
- //This shows that the modifications to the SubSubClass did not bubble back up to it's superclass
- ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true");
- ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!");
- deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly");
- deepEqual(Subclass(document).subSubClassMethod, undefined, "subSubClassMethod set incorrectly");
- equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");
+ expect(18);
+ var Subclass = jQuery.sub();
+ Subclass.extend({
+ topLevelMethod: function() {return this.debug;},
+ debug: false,
+ config: {
+ locale: "en_US"
+ },
+ setup: function(config) {
+ this.extend(true, this.config, config);
+ }
+ });
+ Subclass.fn.extend({subClassMethod: function() { return this;}});
+
+ //Test Simple Subclass
+ ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true");
+ ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!");
+ deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly");
+ equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");
+
+ //Create a SubSubclass
+ var SubSubclass = Subclass.sub();
+
+ //Make Sure the SubSubclass inherited properly
+ ok(SubSubclass.topLevelMethod() === false, "SubSubclass.topLevelMethod thought debug was true");
+ ok(SubSubclass.config.locale == "en_US", SubSubclass.config.locale + " is wrong!");
+ deepEqual(SubSubclass.config.test, undefined, "SubSubclass.config.test is set incorrectly");
+ equal(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");
+
+ //Modify The Subclass and test the Modifications
+ SubSubclass.fn.extend({subSubClassMethod: function() { return this;}});
+ SubSubclass.setup({locale: "es_MX", test: "worked"});
+ SubSubclass.debug = true;
+ SubSubclass.ajax = function() {return false;};
+ ok(SubSubclass.topLevelMethod(), "SubSubclass.topLevelMethod thought debug was false");
+ deepEqual(SubSubclass(document).subClassMethod, Subclass.fn.subClassMethod, "Methods Differ!");
+ ok(SubSubclass.config.locale == "es_MX", SubSubclass.config.locale + " is wrong!");
+ ok(SubSubclass.config.test == "worked", "SubSubclass.config.test is set incorrectly");
+ notEqual(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");
+
+ //This shows that the modifications to the SubSubClass did not bubble back up to it's superclass
+ ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true");
+ ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!");
+ deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly");
+ deepEqual(Subclass(document).subSubClassMethod, undefined, "subSubClassMethod set incorrectly");
+ equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");
});
test("jQuery.sub() - .fn Methods", function(){