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,13 +11,13 @@ getJasmineRequireObj().toHaveBeenCalled = function(j$) {
|
||||
* expect(mySpy).toHaveBeenCalled();
|
||||
* expect(mySpy).not.toHaveBeenCalled();
|
||||
*/
|
||||
function toHaveBeenCalled() {
|
||||
function toHaveBeenCalled(matchersUtil) {
|
||||
return {
|
||||
compare: function(actual) {
|
||||
var result = {};
|
||||
|
||||
if (!j$.isSpy(actual)) {
|
||||
throw new Error(getErrorMsg('Expected a spy, but got ' + j$.pp(actual) + '.'));
|
||||
throw new Error(getErrorMsg('Expected a spy, but got ' + matchersUtil.pp(actual) + '.'));
|
||||
}
|
||||
|
||||
if (arguments.length > 1) {
|
||||
|
||||
Reference in New Issue
Block a user