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
@@ -11,14 +11,14 @@ getJasmineRequireObj().toHaveBeenCalledBefore = function(j$) {
|
||||
* @example
|
||||
* expect(mySpy).toHaveBeenCalledBefore(otherSpy);
|
||||
*/
|
||||
function toHaveBeenCalledBefore() {
|
||||
function toHaveBeenCalledBefore(matchersUtil) {
|
||||
return {
|
||||
compare: function(firstSpy, latterSpy) {
|
||||
if (!j$.isSpy(firstSpy)) {
|
||||
throw new Error(getErrorMsg('Expected a spy, but got ' + j$.pp(firstSpy) + '.'));
|
||||
throw new Error(getErrorMsg('Expected a spy, but got ' + matchersUtil.pp(firstSpy) + '.'));
|
||||
}
|
||||
if (!j$.isSpy(latterSpy)) {
|
||||
throw new Error(getErrorMsg('Expected a spy, but got ' + j$.pp(latterSpy) + '.'));
|
||||
throw new Error(getErrorMsg('Expected a spy, but got ' + matchersUtil.pp(latterSpy) + '.'));
|
||||
}
|
||||
|
||||
var result = { pass: false };
|
||||
|
||||
Reference in New Issue
Block a user