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
@@ -7,7 +7,7 @@ getJasmineRequireObj().toBeNegativeInfinity = function(j$) {
|
||||
* @example
|
||||
* expect(thing).toBeNegativeInfinity();
|
||||
*/
|
||||
function toBeNegativeInfinity() {
|
||||
function toBeNegativeInfinity(matchersUtil) {
|
||||
return {
|
||||
compare: function(actual) {
|
||||
var result = {
|
||||
@@ -17,7 +17,7 @@ getJasmineRequireObj().toBeNegativeInfinity = function(j$) {
|
||||
if (result.pass) {
|
||||
result.message = 'Expected actual not to be -Infinity.';
|
||||
} else {
|
||||
result.message = function() { return 'Expected ' + j$.pp(actual) + ' to be -Infinity.'; };
|
||||
result.message = function() { return 'Expected ' + matchersUtil.pp(actual) + ' to be -Infinity.'; };
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user