Show the name of the constructor function when printing an any

- instead of a `toString` of the entire constructor

Fixes #796
This commit is contained in:
Gregg Van Hove
2015-03-03 13:27:31 -08:00
parent dc652cfb05
commit c77ff30263
2 changed files with 3 additions and 4 deletions

View File

@@ -22,7 +22,7 @@ describe("Any", function() {
expect(any.asymmetricMatch({})).toBe(true);
});
it("matches a Boolean", function() {
var any = new j$.Any(Boolean);
@@ -39,8 +39,7 @@ describe("Any", function() {
it("jasmineToString's itself", function() {
var any = new j$.Any(Number);
expect(any.jasmineToString()).toMatch('<jasmine.any');
expect(any.jasmineToString()).toMatch('Number');
expect(any.jasmineToString()).toEqual('<jasmine.any(Number)>');
});
});

View File

@@ -29,7 +29,7 @@ getJasmineRequireObj().Any = function() {
};
Any.prototype.jasmineToString = function() {
return '<jasmine.any(' + this.expectedObject + ')>';
return '<jasmine.any(' + j$.fnNameFor(this.expectedObject) + ')>';
};
return Any;