diff --git a/spec/core/PrettyPrintSpec.js b/spec/core/PrettyPrintSpec.js index 4783ac4e..fcaab1e6 100644 --- a/spec/core/PrettyPrintSpec.js +++ b/spec/core/PrettyPrintSpec.js @@ -189,24 +189,13 @@ describe("jasmineUnderTest.pp", function () { expect(jasmineUnderTest.pp(obj)).toEqual("my toString"); }); - it("should stringify objects from named constructors with custom toString", function () { - var MyNamedConstructor = function MyNamedConstructor () {}; - MyNamedConstructor.toString = function () { return ""; }; - - var a = {}; - a.constructor = MyNamedConstructor; - - expect(jasmineUnderTest.pp(a)).toEqual("MyNamedConstructor({ constructor: Function })"); - }); - it("should stringify objects from anonymous constructors with custom toString", function () { - var MyAnonymousConstructor = function () {}; - MyAnonymousConstructor.toString = function () { return ""; }; + var MyAnonymousConstructor = (function() { return function () {}; })(); + MyAnonymousConstructor.toString = function () { return ''; }; - var a = {}; - a.constructor = MyAnonymousConstructor; + var a = new MyAnonymousConstructor(); - expect(jasmineUnderTest.pp(a)).toEqual("({ constructor: Function })"); + expect(jasmineUnderTest.pp(a)).toEqual("({ })"); }); it("should handle objects with null prototype", function() {