/*
= Test Framework
version 1.0
created by M@ McCray (http://www.mattmccray.com)
This is a simple JavaScript test framework.
= TODO:
* Add support for calling Tests.setup() and Tests.teardown()
* Documentation!
* Add support for methods that don't start with 'test'?
* Make test method names more English?
*/
// We're gonna run all this in it's own scope so it doesn't pollute the test namespace
(function(){
var HTML = {
_all_tags: ['a','abbr','acronym','address','area','b','base','bdo','big','blockquote','body','br','button','caption','cite','code','col','colgroup','dd','del','dfn','div','dl','DOCTYPE','dt','em','fieldset','form','h1','h2','h3','h4','h5','h6','head','html','hr','i','img','input','ins','kbd','label','legend','li','link','map','meta','noscript','object','ol','optgroup','option','p','param','pre','q','samp','script','select','small','span','strong','style','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','ul'],
_init: function() {
for(var $i=0; $i';
else
return '<'+ tag + $atts +'>'+ $content +''+ tag +'>';
},
namespace: 'var text = HTML.text',
toString: function() { return this.namespace; },
text: function() {
var $content='';
for(var $i=0; $i 0)
return html;
else
return '';
}
function setStatus(msg) {
$('status').innerHTML = msg;
}
function setResults(func, msg) {
$(func+'-error').innerHTML = msg;
}
function assertError(errorMessage, assertionType, extraInfo) {
window.assertionFailCount++;
assertionFailures.push({
assertionType: assertionType,
message: errorMessage,
extraInformation: extraInfo.toString().replace(/