Fix html escaping of matcher failure messages.

This commit is contained in:
Christian Williams
2009-11-12 16:13:44 -05:00
parent 5a8a050c46
commit ee5905d237
2 changed files with 14 additions and 3 deletions

View File

@@ -122,6 +122,19 @@ describe("TrivialReporter", function() {
var divs = body.getElementsByTagName("div");
expect(divs[3].innerHTML).toEqual("Expected 'a' to be null, but it was not");
});
it("should add the failure message to the DOM (non-toEquals matchers)", function() {
expectationResult = new jasmine.ExpectationResult({
matcherName: "toBeNull", passed: false, message: "Expected '1 < 2' to <b>e null, & it was not"
});
spyOn(results, 'getItems').andReturn([expectationResult]);
trivialReporter.reportSpecResults(spec);
var divs = body.getElementsByTagName("div");
expect(divs[3].innerHTML).toEqual("Expected '1 &lt; 2' to &lt;b&gt;e null, &amp; it was not");
});
});
});