Removed deprecated jasmine.include().
Removed deprecated ExpectationResult.details. Removed deprecated Spec.getResults().
This commit is contained in:
parent
413be6b4ca
commit
2a3376d11e
@ -85,9 +85,6 @@ jasmine.ExpectationResult = function(params) {
|
||||
this.expected = params.expected;
|
||||
this.actual = params.actual;
|
||||
|
||||
/** @deprecated */
|
||||
this.details = params.details;
|
||||
|
||||
this.message = this.passed_ ? 'Passed.' : params.message;
|
||||
this.trace = this.passed_ ? '' : new Error(this.message);
|
||||
};
|
||||
@ -577,31 +574,6 @@ jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
|
||||
}
|
||||
throw new Error("This browser does not support XMLHttpRequest.");
|
||||
} : XMLHttpRequest;
|
||||
|
||||
/**
|
||||
* Adds suite files to an HTML document so that they are executed, thus adding them to the current
|
||||
* Jasmine environment.
|
||||
*
|
||||
* @param {String} url path to the file to include
|
||||
* @param {Boolean} opt_global
|
||||
* @deprecated We suggest you use a different method of including JS source files. <code>jasmine.include</code> will be removed soon.
|
||||
*/
|
||||
jasmine.include = function(url, opt_global) {
|
||||
if (opt_global) {
|
||||
document.write('<script type="text/javascript" src="' + url + '"></' + 'script>');
|
||||
} else {
|
||||
var xhr;
|
||||
try {
|
||||
xhr = new jasmine.XmlHttpRequest();
|
||||
xhr.open("GET", url, false);
|
||||
xhr.send(null);
|
||||
} catch(e) {
|
||||
throw new Error("couldn't fetch " + url + ": " + e);
|
||||
}
|
||||
|
||||
return eval(xhr.responseText);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @namespace
|
||||
*/
|
||||
@ -1100,25 +1072,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;
|
||||
};
|
||||
|
||||
jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
|
||||
@ -1743,50 +1701,6 @@ jasmine.Queue.prototype.results = function() {
|
||||
};
|
||||
|
||||
|
||||
/** 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;
|
||||
};
|
||||
|
||||
/**
|
||||
* Runner
|
||||
*
|
||||
@ -1907,11 +1821,6 @@ jasmine.Spec.prototype.log = function() {
|
||||
return this.results_.log(arguments);
|
||||
};
|
||||
|
||||
/** @deprecated */
|
||||
jasmine.Spec.prototype.getResults = function() {
|
||||
return this.results_;
|
||||
};
|
||||
|
||||
jasmine.Spec.prototype.runs = function (func) {
|
||||
var block = new jasmine.Block(this.env, func, this);
|
||||
this.addToQueue(block);
|
||||
@ -2387,5 +2296,5 @@ jasmine.version_= {
|
||||
"major": 0,
|
||||
"minor": 10,
|
||||
"build": 4,
|
||||
"revision": 1277248808
|
||||
"revision": 1277253444
|
||||
};
|
||||
|
@ -41,11 +41,6 @@ jasmine.Spec.prototype.log = function() {
|
||||
return this.results_.log(arguments);
|
||||
};
|
||||
|
||||
/** @deprecated */
|
||||
jasmine.Spec.prototype.getResults = function() {
|
||||
return this.results_;
|
||||
};
|
||||
|
||||
jasmine.Spec.prototype.runs = function (func) {
|
||||
var block = new jasmine.Block(this.env, func, this);
|
||||
this.addToQueue(block);
|
||||
|
28
src/base.js
28
src/base.js
@ -85,9 +85,6 @@ jasmine.ExpectationResult = function(params) {
|
||||
this.expected = params.expected;
|
||||
this.actual = params.actual;
|
||||
|
||||
/** @deprecated */
|
||||
this.details = params.details;
|
||||
|
||||
this.message = this.passed_ ? 'Passed.' : params.message;
|
||||
this.trace = this.passed_ ? '' : new Error(this.message);
|
||||
};
|
||||
@ -577,28 +574,3 @@ jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
|
||||
}
|
||||
throw new Error("This browser does not support XMLHttpRequest.");
|
||||
} : XMLHttpRequest;
|
||||
|
||||
/**
|
||||
* Adds suite files to an HTML document so that they are executed, thus adding them to the current
|
||||
* Jasmine environment.
|
||||
*
|
||||
* @param {String} url path to the file to include
|
||||
* @param {Boolean} opt_global
|
||||
* @deprecated We suggest you use a different method of including JS source files. <code>jasmine.include</code> will be removed soon.
|
||||
*/
|
||||
jasmine.include = function(url, opt_global) {
|
||||
if (opt_global) {
|
||||
document.write('<script type="text/javascript" src="' + url + '"></' + 'script>');
|
||||
} else {
|
||||
var xhr;
|
||||
try {
|
||||
xhr = new jasmine.XmlHttpRequest();
|
||||
xhr.open("GET", url, false);
|
||||
xhr.send(null);
|
||||
} catch(e) {
|
||||
throw new Error("couldn't fetch " + url + ": " + e);
|
||||
}
|
||||
|
||||
return eval(xhr.responseText);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user