X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=739868bd7bf5d9d4b53e8f8cce78bb713d95dbd1;hp=2fc6f18899886570c5caa9f62de2728bc17feaa8;hb=f1bd0cfc4d3eabf566b6a3345d888e6db67bc00b;hpb=88fc523c59465b28633de91f4c9e87b8364064b7 diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 2fc6f18..739868b 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -1,4 +1,7 @@ -module("manipulation"); +module("manipulation", { teardown: moduleTeardown }); + +// Ensure that an extended Array prototype doesn't break jQuery +Array.prototype.arrayProtoFn = function(arg) { throw("arrayProtoFn should not be called"); }; var bareObj = function(value) { return value; }; var functionReturningObj = function(value) { return (function() { return value; }); }; @@ -37,21 +40,21 @@ test("text(Function)", function() { test("text(Function) with incoming value", function() { expect(2); - + var old = "This link has class=\"blog\": Simon Willison's Weblog"; - + jQuery('#sap').text(function(i, val) { equals( val, old, "Make sure the incoming value is correct." ); return "foobar"; }); - + equals( jQuery("#sap").text(), "foobar", 'Check for merged text of more then one element.' ); - + QUnit.reset(); }); var testWrap = function(val) { - expect(18); + expect(19); var defaultText = 'Try them out:' var result = jQuery('#first').wrap(val( '
' )).text(); equals( defaultText, result, 'Check for wrapping of on-the-fly html' ); @@ -80,10 +83,20 @@ var testWrap = function(val) { equals( jQuery("#nonnodes > i").text(), j.text(), "Check node,textnode,comment wraps doesn't hurt text" ); // Try wrapping a disconnected node + var cacheLength = 0; + for (var i in jQuery.cache) { + cacheLength++; + } + j = jQuery("