From b6e408aab83dac8f4ca360cd2d35d80c2d182ee1 Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Mon, 19 Oct 2009 17:53:29 -0700 Subject: [PATCH] Remove @deprecated methods. --- spec/suites/SuiteSpec.js | 4 ++-- src/Matchers.js | 25 ------------------------- src/Runner.js | 10 ---------- src/Spec.js | 13 ------------- src/Suite.js | 10 ---------- 5 files changed, 2 insertions(+), 60 deletions(-) diff --git a/spec/suites/SuiteSpec.js b/spec/suites/SuiteSpec.js index f426b6a..83eda51 100644 --- a/spec/suites/SuiteSpec.js +++ b/spec/suites/SuiteSpec.js @@ -68,7 +68,7 @@ describe('Suite', function() { }); }); - expect(suite.specCount()).toEqual(3); + expect(suite.specs().length).toEqual(3); }); it('specCount should be correct even with runs/waits blocks', function() { @@ -94,7 +94,7 @@ describe('Suite', function() { }); }); - expect(suite.specCount()).toEqual(3); + expect(suite.specs().length).toEqual(3); }); }); }); diff --git a/src/Matchers.js b/src/Matchers.js index 6733d58..8fad5ec 100644 --- a/src/Matchers.js +++ b/src/Matchers.js @@ -9,11 +9,6 @@ jasmine.Matchers.pp = function(str) { return jasmine.util.htmlEscape(jasmine.pp(str)); }; -/** @deprecated */ -jasmine.Matchers.prototype.getResults = function() { - return this.results_; -}; - jasmine.Matchers.prototype.results = function() { return this.results_; }; @@ -70,8 +65,6 @@ jasmine.Matchers.prototype.toEqual = function(expected) { matcherName: 'toEqual', expected: expected, actual: this.actual }); }; -/** @deprecated */ -jasmine.Matchers.prototype.should_equal = jasmine.Matchers.prototype.toEqual; /** * Matcher that compares the actual to the expected using the ! of jasmine.Matchers.toEqual @@ -81,8 +74,6 @@ jasmine.Matchers.prototype.toNotEqual = function(expected) { return this.report(!this.env.equals_(this.actual, expected), 'Expected ' + jasmine.Matchers.pp(expected) + ' to not equal ' + jasmine.Matchers.pp(this.actual) + ', but it does.'); }; -/** @deprecated */ -jasmine.Matchers.prototype.should_not_equal = jasmine.Matchers.prototype.toNotEqual; /** * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes @@ -94,8 +85,6 @@ jasmine.Matchers.prototype.toMatch = function(reg_exp) { return this.report((new RegExp(reg_exp).test(this.actual)), 'Expected ' + jasmine.Matchers.pp(this.actual) + ' to match ' + reg_exp + '.'); }; -/** @deprecated */ -jasmine.Matchers.prototype.should_match = jasmine.Matchers.prototype.toMatch; /** * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch @@ -105,8 +94,6 @@ jasmine.Matchers.prototype.toNotMatch = function(reg_exp) { return this.report((!new RegExp(reg_exp).test(this.actual)), 'Expected ' + jasmine.Matchers.pp(this.actual) + ' to not match ' + reg_exp + '.'); }; -/** @deprecated */ -jasmine.Matchers.prototype.should_not_match = jasmine.Matchers.prototype.toNotMatch; /** * Matcher that compares the acutal to undefined. @@ -115,8 +102,6 @@ jasmine.Matchers.prototype.toBeDefined = function() { return this.report((this.actual !== undefined), 'Expected a value to be defined but it was undefined.'); }; -/** @deprecated */ -jasmine.Matchers.prototype.should_be_defined = jasmine.Matchers.prototype.toBeDefined; /** * Matcher that compares the actual to null. @@ -126,8 +111,6 @@ jasmine.Matchers.prototype.toBeNull = function() { return this.report((this.actual === null), 'Expected a value to be null but it was ' + jasmine.Matchers.pp(this.actual) + '.'); }; -/** @deprecated */ -jasmine.Matchers.prototype.should_be_null = jasmine.Matchers.prototype.toBeNull; /** * Matcher that boolean not-nots the actual. @@ -136,8 +119,6 @@ jasmine.Matchers.prototype.toBeTruthy = function() { return this.report(!!this.actual, 'Expected a value to be truthy but it was ' + jasmine.Matchers.pp(this.actual) + '.'); }; -/** @deprecated */ -jasmine.Matchers.prototype.should_be_truthy = jasmine.Matchers.prototype.toBeTruthy; /** * Matcher that boolean nots the actual. @@ -146,8 +127,6 @@ jasmine.Matchers.prototype.toBeFalsy = function() { return this.report(!this.actual, 'Expected a value to be falsy but it was ' + jasmine.Matchers.pp(this.actual) + '.'); }; -/** @deprecated */ -jasmine.Matchers.prototype.should_be_falsy = jasmine.Matchers.prototype.toBeFalsy; /** * Matcher that checks to see if the acutal, a Jasmine spy, was called. @@ -162,8 +141,6 @@ jasmine.Matchers.prototype.wasCalled = function() { return this.report((this.actual.wasCalled), 'Expected spy "' + this.actual.identity + '" to have been called, but it was not.'); }; -/** @deprecated */ -jasmine.Matchers.prototype.was_called = jasmine.Matchers.prototype.wasCalled; /** * Matcher that checks to see if the acutal, a Jasmine spy, was not called. @@ -175,8 +152,6 @@ jasmine.Matchers.prototype.wasNotCalled = function() { return this.report((!this.actual.wasCalled), 'Expected spy "' + this.actual.identity + '" to not have been called, but it was.'); }; -/** @deprecated */ -jasmine.Matchers.prototype.was_not_called = jasmine.Matchers.prototype.wasNotCalled; /** * Matcher that checks to see if the acutal, a Jasmine spy, was called with a set of parameters. diff --git a/src/Runner.js b/src/Runner.js index eb987f2..ee850d7 100644 --- a/src/Runner.js +++ b/src/Runner.js @@ -49,11 +49,6 @@ jasmine.Runner.prototype.add = function(block) { this.queue.add(block); }; -/** @deprecated */ -jasmine.Runner.prototype.getAllSuites = function() { - return this.suites_; -}; - jasmine.Runner.prototype.specs = function () { var suites = this.suites(); var specs = []; @@ -70,9 +65,4 @@ jasmine.Runner.prototype.suites = function() { jasmine.Runner.prototype.results = function() { return this.queue.results(); -}; - -/** @deprecated */ -jasmine.Runner.prototype.getResults = function() { - return this.queue.results(); }; \ No newline at end of file diff --git a/src/Spec.js b/src/Spec.js index 5ae6b60..602f371 100644 --- a/src/Spec.js +++ b/src/Spec.js @@ -43,11 +43,6 @@ jasmine.Spec.prototype.log = function(message) { return this.results_.log(message); }; -/** @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); @@ -62,14 +57,6 @@ jasmine.Spec.prototype.addToQueue = function (block) { } }; -/** - * @private - * @deprecated - */ -jasmine.Spec.prototype.expects_that = function(actual) { - return this.expect(actual); -}; - jasmine.Spec.prototype.expect = function(actual) { return new (this.getMatchersClass_())(this.env, actual, this.results_); }; diff --git a/src/Suite.js b/src/Suite.js index e1e5ea1..6d7698a 100644 --- a/src/Suite.js +++ b/src/Suite.js @@ -45,11 +45,6 @@ jasmine.Suite.prototype.afterEach = function(afterEachFunction) { this.after_.push(afterEachFunction); }; -/** @deprecated */ -jasmine.Suite.prototype.getResults = function() { - return this.queue.results(); -}; - jasmine.Suite.prototype.results = function() { return this.queue.results(); }; @@ -63,11 +58,6 @@ jasmine.Suite.prototype.add = function(block) { this.queue.add(block); }; -/** @deprecated */ -jasmine.Suite.prototype.specCount = function() { - return this.specs_.length; -}; - jasmine.Suite.prototype.specs = function() { return this.specs_; };