diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-04-04 16:44:15 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-04-04 16:44:15 +0000 |
commit | 7740e89de3e1bc0cc636120e3ca8ab9e97e4d3cc (patch) | |
tree | c6fd23b598f3994eddb18cb1c0f2e8d95ff054fa /wp-includes/js/scriptaculous/unittest.js | |
parent | f650f48c048bfbbb2ae702b6425d87e39358d748 (diff) | |
download | wordpress-mu-7740e89de3e1bc0cc636120e3ca8ab9e97e4d3cc.tar.gz wordpress-mu-7740e89de3e1bc0cc636120e3ca8ab9e97e4d3cc.tar.xz wordpress-mu-7740e89de3e1bc0cc636120e3ca8ab9e97e4d3cc.zip |
Merged with WordPress 2.5, unstable, only for testing
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1218 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/js/scriptaculous/unittest.js')
-rw-r--r-- | wp-includes/js/scriptaculous/unittest.js | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/wp-includes/js/scriptaculous/unittest.js b/wp-includes/js/scriptaculous/unittest.js index 45c3776..959f13c 100644 --- a/wp-includes/js/scriptaculous/unittest.js +++ b/wp-includes/js/scriptaculous/unittest.js @@ -1,4 +1,4 @@ -// script.aculo.us unittest.js v1.7.1_beta3, Fri May 25 17:19:41 +0200 2007 +// script.aculo.us unittest.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) @@ -121,7 +121,7 @@ Test.Unit.Logger.prototype = { this.loglines = $('loglines'); }, _toHTML: function(txt) { - return txt.escapeHTML().replace(/\n/g,"<br />"); + return txt.escapeHTML().replace(/\n/g,"<br/>"); }, addLinksToResults: function(){ $$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log @@ -524,15 +524,19 @@ Test.setupBDDExtensionMethods = function(){ shouldNotBe: 'assertReturnsFalse', shouldRespondTo: 'assertRespondsTo' }; - Test.BDDMethods = {}; - for(m in METHODMAP) { - Test.BDDMethods[m] = eval( - 'function(){'+ - 'var args = $A(arguments);'+ - 'var scope = args.shift();'+ - 'scope.'+METHODMAP[m]+'.apply(scope,(args || []).concat([this])); }'); + var makeAssertion = function(assertion, args, object) { + this[assertion].apply(this,(args || []).concat([object])); } - [Array.prototype, String.prototype, Number.prototype].each( + + Test.BDDMethods = {}; + $H(METHODMAP).each(function(pair) { + Test.BDDMethods[pair.key] = function() { + var args = $A(arguments); + var scope = args.shift(); + makeAssertion.apply(scope, [pair.value, args, this]); }; + }); + + [Array.prototype, String.prototype, Number.prototype, Boolean.prototype].each( function(p){ Object.extend(p, Test.BDDMethods) } ); } |