Merge branch 'master' of git@github.com:pivotal/jasmine

This commit is contained in:
Christian Williams
2009-12-25 11:41:07 -05:00
37 changed files with 2530 additions and 2057 deletions

View File

@@ -211,12 +211,28 @@ jasmine.Matchers.prototype.wasCalledWith = function() {
}
this.message = function() {
return "Expected spy to have been called with " + jasmine.pp(arguments) + " but was called with " + jasmine.pp(this.actual.argsForCall);
if (this.actual.callCount == 0) {
return "Expected spy to have been called with " + jasmine.pp(arguments) + " but it was never called.";
} else {
return "Expected spy to have been called with " + jasmine.pp(arguments) + " but was called with " + jasmine.pp(this.actual.argsForCall);
}
};
return this.env.contains_(this.actual.argsForCall, jasmine.util.argsToArray(arguments));
};
jasmine.Matchers.prototype.wasNotCalledWith = function() {
if (!jasmine.isSpy(this.actual)) {
throw new Error('Expected a spy, but got ' + jasmine.Matchers.pp(this.actual) + '.');
}
this.message = function() {
return "Expected spy not to have been called with " + jasmine.pp(arguments) + " but it was";
};
return !this.env.contains_(this.actual.argsForCall, jasmine.util.argsToArray(arguments));
};
/**
* Matcher that checks that the expected item is an element in the actual Array.
*