Use jasmineToString for printing out complicated matchers

This commit is contained in:
gvanhove
2011-03-14 18:50:08 -07:00
parent 7158fc2426
commit 4f2fcff15a
4 changed files with 49 additions and 10 deletions

View File

@@ -23,10 +23,8 @@ jasmine.PrettyPrinter.prototype.format = function(value) {
this.emitScalar('null');
} else if (value === jasmine.getGlobal()) {
this.emitScalar('<global>');
} else if (value instanceof jasmine.Matchers.Any) {
this.emitScalar(value.toString());
} else if (value instanceof jasmine.Matchers.ObjectContaining) {
this.emitScalar(value.toString());
} else if (value.hasOwnProperty("jasmineToString")) {
this.emitScalar(value.jasmineToString());
} else if (typeof value === 'string') {
this.emitString(value);
} else if (jasmine.isSpy(value)) {