From a661e77345a32bf8601c259c2d4c644e0f253f45 Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Fri, 5 Mar 2010 22:34:37 -0500 Subject: [PATCH] Remove jasmine.Matchers.pp(), use jasmine.pp() instead. --- spec/suites/MatchersSpec.js | 4 ++++ src/Matchers.js | 12 ++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/suites/MatchersSpec.js b/spec/suites/MatchersSpec.js index 32b7e5f..6d54bb1 100644 --- a/spec/suites/MatchersSpec.js +++ b/spec/suites/MatchersSpec.js @@ -554,6 +554,10 @@ describe("jasmine.Matchers", function() { expect(function() { match({some:'object'})[methodName](); }).toThrow('Expected a spy, but got { some : \'object\' }.'); + + expect(function() { + match("")[methodName](); + }).toThrow('Expected a spy, but got \'\'.'); }; } diff --git a/src/Matchers.js b/src/Matchers.js index 4b27692..672e030 100644 --- a/src/Matchers.js +++ b/src/Matchers.js @@ -12,10 +12,6 @@ jasmine.Matchers = function(env, actual, spec, opt_isNot) { this.reportWasCalled_ = false; }; -jasmine.Matchers.pp = function(str) { - return jasmine.util.htmlEscape(jasmine.pp(str)); -}; - /** @deprecated */ jasmine.Matchers.prototype.report = function(result, failing_message, details) { // todo: report a deprecation warning [xw] @@ -183,7 +179,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() { @@ -202,7 +198,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() { @@ -221,7 +217,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) { @@ -237,7 +233,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() {