Inject a per-runable pretty printer into MatchersUtil
This will allow us to add support for custom object formatters, which will be a per-runable resource like custom matchers, by injecting them into the pretty-printer.
This commit is contained in:
committed by
Steve Gravrock
parent
dec67bd535
commit
1f23f1e4d2
@@ -9,7 +9,7 @@ describe("toBe", function() {
|
||||
});
|
||||
|
||||
it("passes with a custom message when expected is an array", function() {
|
||||
var util = new jasmineUnderTest.MatchersUtil(),
|
||||
var util = new jasmineUnderTest.MatchersUtil({pp: jasmineUnderTest.makePrettyPrinter()}),
|
||||
matcher = jasmineUnderTest.matchers.toBe(util),
|
||||
result,
|
||||
array = [1];
|
||||
@@ -20,7 +20,7 @@ describe("toBe", function() {
|
||||
});
|
||||
|
||||
it("passes with a custom message when expected is an object", function() {
|
||||
var util = new jasmineUnderTest.MatchersUtil(),
|
||||
var util = new jasmineUnderTest.MatchersUtil({pp: jasmineUnderTest.makePrettyPrinter()}),
|
||||
matcher = jasmineUnderTest.matchers.toBe(util),
|
||||
result,
|
||||
obj = {foo: "bar"};
|
||||
@@ -41,7 +41,7 @@ describe("toBe", function() {
|
||||
});
|
||||
|
||||
it("fails with a custom message when expected is an array", function() {
|
||||
var util = new jasmineUnderTest.MatchersUtil(),
|
||||
var util = new jasmineUnderTest.MatchersUtil({pp: jasmineUnderTest.makePrettyPrinter()}),
|
||||
matcher = jasmineUnderTest.matchers.toBe(util),
|
||||
result;
|
||||
|
||||
@@ -51,7 +51,7 @@ describe("toBe", function() {
|
||||
});
|
||||
|
||||
it("fails with a custom message when expected is an object", function() {
|
||||
var util = new jasmineUnderTest.MatchersUtil(),
|
||||
var util = new jasmineUnderTest.MatchersUtil({pp: jasmineUnderTest.makePrettyPrinter()}),
|
||||
matcher = jasmineUnderTest.matchers.toBe(util),
|
||||
result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user