Remove jasmine.Matchers.pp(), use jasmine.pp() instead.

This commit is contained in:
Christian Williams 2010-03-05 22:34:37 -05:00
parent 564b9a0c3e
commit a661e77345
2 changed files with 8 additions and 8 deletions

View File

@ -554,6 +554,10 @@ describe("jasmine.Matchers", function() {
expect(function() { expect(function() {
match({some:'object'})[methodName](); match({some:'object'})[methodName]();
}).toThrow('Expected a spy, but got { some : \'object\' }.'); }).toThrow('Expected a spy, but got { some : \'object\' }.');
expect(function() {
match("<b>")[methodName]();
}).toThrow('Expected a spy, but got \'<b>\'.');
}; };
} }

View File

@ -12,10 +12,6 @@ jasmine.Matchers = function(env, actual, spec, opt_isNot) {
this.reportWasCalled_ = false; this.reportWasCalled_ = false;
}; };
jasmine.Matchers.pp = function(str) {
return jasmine.util.htmlEscape(jasmine.pp(str));
};
/** @deprecated */ /** @deprecated */
jasmine.Matchers.prototype.report = function(result, failing_message, details) { jasmine.Matchers.prototype.report = function(result, failing_message, details) {
// todo: report a deprecation warning [xw] // todo: report a deprecation warning [xw]
@ -183,7 +179,7 @@ jasmine.Matchers.prototype.wasCalled = function() {
} }
if (!jasmine.isSpy(this.actual)) { 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() { this.message = function() {
@ -202,7 +198,7 @@ jasmine.Matchers.prototype.wasNotCalled = function() {
} }
if (!jasmine.isSpy(this.actual)) { 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() { this.message = function() {
@ -221,7 +217,7 @@ jasmine.Matchers.prototype.wasNotCalled = function() {
jasmine.Matchers.prototype.wasCalledWith = function() { jasmine.Matchers.prototype.wasCalledWith = function() {
var expectedArgs = jasmine.util.argsToArray(arguments); var expectedArgs = jasmine.util.argsToArray(arguments);
if (!jasmine.isSpy(this.actual)) { 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() { this.message = function() {
if (this.actual.callCount == 0) { if (this.actual.callCount == 0) {
@ -237,7 +233,7 @@ jasmine.Matchers.prototype.wasCalledWith = function() {
jasmine.Matchers.prototype.wasNotCalledWith = function() { jasmine.Matchers.prototype.wasNotCalledWith = function() {
var expectedArgs = jasmine.util.argsToArray(arguments); var expectedArgs = jasmine.util.argsToArray(arguments);
if (!jasmine.isSpy(this.actual)) { 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() { this.message = function() {