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.
*

View File

@@ -501,10 +501,8 @@ var xdescribe = function(description, specDefinitions) {
};
jasmine.XmlHttpRequest = XMLHttpRequest;
// Provide the XMLHttpRequest class for IE 5.x-6.x:
if (typeof XMLHttpRequest == "undefined") jasmine.XmlHttpRequest = function() {
jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
try {
return new ActiveXObject("Msxml2.XMLHTTP.6.0");
} catch(e) {
@@ -522,7 +520,7 @@ if (typeof XMLHttpRequest == "undefined") jasmine.XmlHttpRequest = function() {
} catch(e) {
}
throw new Error("This browser does not support XMLHttpRequest.");
};
} : XMLHttpRequest;
/**
* Adds suite files to an HTML document so that they are executed, thus adding them to the current