Remove deprecated class jasmine.Reporters.

Fully deprecate old-style Matchers; will be removed in next major version.
This commit is contained in:
Lee Byrd & Christian Williams
2010-06-22 17:35:41 -07:00
parent 0539251fe6
commit 413be6b4ca
6 changed files with 12 additions and 115 deletions

View File

@@ -15,25 +15,11 @@ jasmine.Matchers = function(env, actual, spec, opt_isNot) {
// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
jasmine.Matchers.pp = function(str) {
throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
this.report();
};
/** @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. */
// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
jasmine.Matchers.prototype.report = function(result, failing_message, details) {
// todo: report a deprecation warning [xw]
if (this.isNot) {
throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
}
this.reportWasCalled_ = true;
var expectationResult = new jasmine.ExpectationResult({
passed: result,
message: failing_message,
details: details
});
this.spec.addMatcherResult(expectationResult);
return result;
throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
};
jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {

View File

@@ -1,44 +0,0 @@
/** JasmineReporters.reporter
* Base object that will get called whenever a Spec, Suite, or Runner is done. It is up to
* descendants of this object to do something with the results (see json_reporter.js)
*
* @deprecated
*/
jasmine.Reporters = {};
/**
* @deprecated
* @param callbacks
*/
jasmine.Reporters.reporter = function(callbacks) {
/**
* @deprecated
* @param callbacks
*/
var that = {
callbacks: callbacks || {},
doCallback: function(callback, results) {
if (callback) {
callback(results);
}
},
reportRunnerResults: function(runner) {
that.doCallback(that.callbacks.runnerCallback, runner);
},
reportSuiteResults: function(suite) {
that.doCallback(that.callbacks.suiteCallback, suite);
},
reportSpecResults: function(spec) {
that.doCallback(that.callbacks.specCallback, spec);
},
log: function (str) {
var console = jasmine.getGlobal().console;
if (console && console.log) console.log(str);
}
};
return that;
};