Refer to MatchersUtil instances as matchersUtil, not util

This commit is contained in:
Pivotal
2020-02-10 14:12:56 -08:00
committed by Steve Gravrock
parent d41139fea2
commit ea3dd9dffc
21 changed files with 154 additions and 148 deletions

View File

@@ -1,6 +1,8 @@
getJasmineRequireObj().Expector = function(j$) {
function Expector(options) {
this.util = options.util || { buildFailureMessage: function() {} };
this.matchersUtil = options.matchersUtil || {
buildFailureMessage: function() {}
};
this.customEqualityTesters = options.customEqualityTesters || [];
this.actual = options.actual;
this.addExpectationResult = options.addExpectationResult || function() {};
@@ -18,7 +20,7 @@ getJasmineRequireObj().Expector = function(j$) {
this.args.unshift(this.actual);
var matcher = matcherFactory(this.util, this.customEqualityTesters);
var matcher = matcherFactory(this.matchersUtil, this.customEqualityTesters);
var comparisonFunc = this.filters.selectComparisonFunc(matcher);
return comparisonFunc || matcher.compare;
};
@@ -34,7 +36,7 @@ getJasmineRequireObj().Expector = function(j$) {
result,
this.matcherName,
this.args,
this.util,
this.matchersUtil,
defaultMessage
);
return this.filters.modifyFailureMessage(msg || defaultMessage());
@@ -44,7 +46,10 @@ getJasmineRequireObj().Expector = function(j$) {
var args = self.args.slice();
args.unshift(false);
args.unshift(self.matcherName);
return self.util.buildFailureMessage.apply(self.util, args);
return self.matchersUtil.buildFailureMessage.apply(
self.matchersUtil,
args
);
} else if (j$.isFunction_(result.message)) {
return result.message();
} else {