Update anonymous constructor pretty print specs to work in IE

This commit is contained in:
Gregg Van Hove
2016-08-25 15:29:32 -07:00
parent 850204dfb8
commit f196faf0bb

View File

@@ -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("<anonymous>({ constructor: Function })");
expect(jasmineUnderTest.pp(a)).toEqual("<anonymous>({ })");
});
it("should handle objects with null prototype", function() {