Browse files

Rebuild lib/jasmine.

  • Loading branch information...
1 parent 184ff6f commit 72ea614d5e3f13a186a281140db3a16e08e09679 Christian Williams committed Mar 15, 2010
Showing with 22 additions and 19 deletions.
  1. +22 −19 lib/jasmine-0.10.1.js
View
41 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
};

0 comments on commit 72ea614

Please sign in to comment.