Major jasmine updates

This commit is contained in:
ragaskar
2009-03-01 05:34:00 -08:00
parent 9117bcaa41
commit dd8f248f7b
12 changed files with 2565 additions and 1510 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4,28 +4,32 @@
* result. Calling application can then do whatever it wants/needs with the string;
*/
Jasmine.Reporters.JSON = function () {
var toJSON = function(object){
return JSON.stringify(object);
};
var that = Jasmine.Reporters.reporter();
that.specJSON = '';
that.suiteJSON = '';
that.runnerJSON = '';
var saveSpecResults = function (results) {
that.specJSON = Object.toJSON(results);
}
that.specJSON = toJSON(results);
};
that.reportSpecResults = saveSpecResults;
var saveSuiteResults = function (results) {
that.suiteJSON = Object.toJSON(results);
}
that.suiteJSON = toJSON(results);
};
that.reportSuiteResults = saveSuiteResults;
var saveRunnerResults = function (results) {
that.runnerJSON = Object.toJSON(results);
}
that.runnerJSON = toJSON(results);
};
that.reportRunnerResults = saveRunnerResults;
that.toJSON = toJSON;
return that;
}
};
Jasmine.Reporters.domWriter = function (elementId) {
var that = {
@@ -36,12 +40,12 @@ Jasmine.Reporters.domWriter = function (elementId) {
that.element.innerHTML += text;
}
}
}
};
that.element.innerHTML = '';
return that;
}
};
Jasmine.Reporters.JSONtoDOM = function (elementId) {
var that = Jasmine.Reporters.JSON();
@@ -49,10 +53,10 @@ Jasmine.Reporters.JSONtoDOM = function (elementId) {
that.domWriter = Jasmine.Reporters.domWriter(elementId);
var writeRunnerResults = function (results) {
that.domWriter.write(Object.toJSON(results));
that.domWriter.write(that.toJSON(results));
};
that.reportRunnerResults = writeRunnerResults;
return that;
}
};