Update anonymous constructor pretty print specs to work in IE
This commit is contained in:
@@ -189,24 +189,13 @@ describe("jasmineUnderTest.pp", function () {
|
|||||||
expect(jasmineUnderTest.pp(obj)).toEqual("my toString");
|
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 () {
|
it("should stringify objects from anonymous constructors with custom toString", function () {
|
||||||
var MyAnonymousConstructor = function () {};
|
var MyAnonymousConstructor = (function() { return function () {}; })();
|
||||||
MyAnonymousConstructor.toString = function () { return ""; };
|
MyAnonymousConstructor.toString = function () { return ''; };
|
||||||
|
|
||||||
var a = {};
|
var a = new MyAnonymousConstructor();
|
||||||
a.constructor = MyAnonymousConstructor;
|
|
||||||
|
|
||||||
expect(jasmineUnderTest.pp(a)).toEqual("<anonymous>({ constructor: Function })");
|
expect(jasmineUnderTest.pp(a)).toEqual("<anonymous>({ })");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle objects with null prototype", function() {
|
it("should handle objects with null prototype", function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user