From 72ea614d5e3f13a186a281140db3a16e08e09679 Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Mon, 15 Mar 2010 12:15:50 -0700 Subject: [PATCH] Rebuild lib/jasmine. --- lib/jasmine-0.10.1.js | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/lib/jasmine-0.10.1.js b/lib/jasmine-0.10.1.js index f9bd7d6..6cf0b57 100644 --- a/lib/jasmine-0.10.1.js +++ b/lib/jasmine-0.10.1.js @@ -794,6 +794,12 @@ jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) { mismatchKeys = mismatchKeys || []; mismatchValues = mismatchValues || []; + for (var i = 0; i < this.equalityTesters_.length; i++) { + var equalityTester = this.equalityTesters_[i]; + var result = equalityTester(a, b, this, mismatchKeys, mismatchValues); + if (result !== jasmine.undefined) return result; + } + if (a === b) return true; if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) { @@ -820,12 +826,6 @@ jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) { return this.compareObjects_(a, b, mismatchKeys, mismatchValues); } - for (var i = 0; i < this.equalityTesters_.length; i++) { - var equalityTester = this.equalityTesters_[i]; - var result = equalityTester(a, b, this, mismatchKeys, mismatchValues); - if (result !== jasmine.undefined) return result; - } - //Straight check return (a === b); }; @@ -1009,11 +1009,13 @@ jasmine.Matchers = function(env, actual, spec, opt_isNot) { this.reportWasCalled_ = false; }; +// todo: @deprecated as of Jasmine 0.11, remove soon [xw] jasmine.Matchers.pp = function(str) { - return jasmine.util.htmlEscape(jasmine.pp(str)); + throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!"); + this.report(); }; -/** @deprecated */ +/** @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. */ jasmine.Matchers.prototype.report = function(result, failing_message, details) { // todo: report a deprecation warning [xw] @@ -1180,7 +1182,7 @@ jasmine.Matchers.prototype.wasCalled = function() { } if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.Matchers.pp(this.actual) + '.'); + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); } this.message = function() { @@ -1199,7 +1201,7 @@ jasmine.Matchers.prototype.wasNotCalled = function() { } if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.Matchers.pp(this.actual) + '.'); + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); } this.message = function() { @@ -1218,7 +1220,7 @@ jasmine.Matchers.prototype.wasNotCalled = function() { jasmine.Matchers.prototype.wasCalledWith = function() { var expectedArgs = jasmine.util.argsToArray(arguments); if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.Matchers.pp(this.actual) + '.'); + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); } this.message = function() { if (this.actual.callCount == 0) { @@ -1234,7 +1236,7 @@ jasmine.Matchers.prototype.wasCalledWith = function() { jasmine.Matchers.prototype.wasNotCalledWith = function() { var expectedArgs = jasmine.util.argsToArray(arguments); if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.Matchers.pp(this.actual) + '.'); + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); } this.message = function() { @@ -1882,8 +1884,7 @@ jasmine.Spec.prototype.finish = function(onComplete) { } }; -jasmine.Spec.prototype.after = function(doAfter, test) { - +jasmine.Spec.prototype.after = function(doAfter) { if (this.queue.isRunning()) { this.queue.add(new jasmine.Block(this.env, doAfter, this)); } else { @@ -1911,23 +1912,25 @@ jasmine.Spec.prototype.execute = function(onComplete) { jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() { var runner = this.env.currentRunner(); + var i; + for (var suite = this.suite; suite; suite = suite.parentSuite) { - for (var i = 0; i < suite.before_.length; i++) { + for (i = 0; i < suite.before_.length; i++) { this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this)); } } - for (var i = 0; i < runner.before_.length; i++) { + for (i = 0; i < runner.before_.length; i++) { this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this)); } for (i = 0; i < this.afterCallbacks.length; i++) { this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this)); } for (suite = this.suite; suite; suite = suite.parentSuite) { - for (var i = 0; i < suite.after_.length; i++) { + for (i = 0; i < suite.after_.length; i++) { this.queue.add(new jasmine.Block(this.env, suite.after_[i], this)); } } - for (var i = 0; i < runner.after_.length; i++) { + for (i = 0; i < runner.after_.length; i++) { this.queue.add(new jasmine.Block(this.env, runner.after_[i], this)); } }; @@ -2272,5 +2275,5 @@ jasmine.version_= { "major": 0, "minor": 10, "build": 1, - "revision": 1267503060 + "revision": 1268680515 };