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

@@ -22,7 +22,6 @@
<script type="text/javascript" src="../src/NestedResults.js"></script>
<script type="text/javascript" src="../src/PrettyPrinter.js"></script>
<script type="text/javascript" src="../src/Queue.js"></script>
<script type="text/javascript" src="../src/Reporters.js"></script>
<script type="text/javascript" src="../src/Runner.js"></script>
<script type="text/javascript" src="../src/Spec.js"></script>
<script type="text/javascript" src="../src/Suite.js"></script>

View File

@@ -85,28 +85,4 @@ describe("Custom Matchers", function() {
expect(matcherCallArgs).toEqual([[], ['arg'], ['arg1', 'arg2']]);
});
describe("in the old style", function() {
it("should report a deprecation error", function() {
var spec;
var suite = env.describe('some suite', function() {
spec = env.it('spec with an expectation').runs(function () {
this.addMatchers({
toBeTrue: function() {
this.report(this.actual === true, this.actual + " was not true.", "details");
}
});
this.expect(true).toBeTrue();
this.expect(false).toBeTrue();
});
});
suite.execute();
var passResult = new jasmine.ExpectationResult({passed: true, message: "Passed.", details: "details"});
var failResult = new jasmine.ExpectationResult({passed: false, message: "false was not true.", details: "details"});
failResult.trace = jasmine.any(Object);
expect(spec.results().getItems()).toEqual([passResult, failResult]);
});
});
});

View File

@@ -523,22 +523,6 @@ describe("jasmine.Matchers", function() {
match(false).not.custom();
expect(lastResult().message).toEqual("Passed.");
});
it("should make old-style custom matchers blow up, but only when negated", function() {
spec.addMatchers({
custom: function() {
this.report();
}
});
expect(function() {
match(true).custom();
}).not.toThrow();
expect(function() {
match(true).not.custom();
}).toThrow();
});
});
describe("spy matchers >>", function() {

View File

@@ -33,20 +33,16 @@ describe('jasmine.Reporter', function() {
var bar = 0;
var baz = 0;
var specCallback = function (results) {
foo++;
};
var suiteCallback = function (results) {
bar++;
};
var runnerCallback = function (results) {
baz++;
};
env.reporter = jasmine.Reporters.reporter({
specCallback: specCallback,
suiteCallback: suiteCallback,
runnerCallback: runnerCallback
env.addReporter({
reportSpecResults: function() {
foo++;
},
reportSuiteResults: function() {
bar++;
},
reportRunnerResults: function() {
baz++;
}
});
var runner = env.currentRunner();