anything and stringMatching have custom pretty-print now.

This commit is contained in:
slackersoft
2015-01-21 12:59:01 -08:00
parent 6ae054c3e2
commit 1dd4af3835
4 changed files with 20 additions and 0 deletions

View File

@@ -35,4 +35,10 @@ describe("Anything", function() {
expect(anything.asymmetricMatch(null)).toBe(false);
});
it("jasmineToString's itself", function() {
var anything = new j$.Anything();
expect(anything.jasmineToString()).toEqual("<jasmine.anything>");
});
});

View File

@@ -18,4 +18,10 @@ describe("StringMatching", function() {
new j$.StringMatching({});
}).toThrowError(/not a String or a RegExp/);
});
it("jasmineToString's itself", function() {
var matching = new j$.StringMatching(/^foo/);
expect(matching.jasmineToString()).toEqual("<jasmine.stringMatching(/^foo/)>");
});
});

View File

@@ -6,5 +6,9 @@ getJasmineRequireObj().Anything = function(j$) {
return !j$.util.isUndefined(other) && other !== null;
};
Anything.prototype.jasmineToString = function() {
return "<jasmine.anything>";
};
return Anything;
};

View File

@@ -12,5 +12,9 @@ getJasmineRequireObj().StringMatching = function(j$) {
return this.regexp.test(other);
};
StringMatching.prototype.jasmineToString = function() {
return "<jasmine.stringMatching(" + this.regexp + ")>";
};
return StringMatching;
};