* Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
*
* @namespace
*/
varjasmine={};
if(isCommonJS)exports.jasmine=jasmine;
/**
* @private
*/
jasmine.unimplementedMethod_=function(){
thrownewError("unimplemented method");
};
/**
* Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
* a plain old variable and may be redefined by somebody else.
*
* @private
*/
jasmine.undefined=jasmine.___undefined___;
/**
* Show diagnostic messages in the console if set to true
*
*/
jasmine.VERBOSE=false;
/**
* Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
*
*/
jasmine.DEFAULT_UPDATE_INTERVAL=250;
/**
* Default timeout interval in milliseconds for waitsFor() blocks.
*/
jasmine.DEFAULT_TIMEOUT_INTERVAL=5000;
jasmine.getGlobal=function(){
functiongetGlobal(){
returnthis;
}
returngetGlobal();
};
/**
* Allows for bound functions to be compared. Internal use only.
*
* @ignore
* @private
* @param base {Object} bound 'this' for the function
mismatchValues.push("'"+property+"' was '"+(b[property]?jasmine.util.htmlEscape(b[property].toString()):b[property])+"' in expected, but was '"+(a[property]?jasmine.util.htmlEscape(a[property].toString()):a[property])+"' in actual.");
thrownewError('Expected a spy, but got '+jasmine.pp(this.actual)+'.');
}
this.message=function(){
if(this.actual.callCount===0){
// todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw]
return[
"Expected spy "+this.actual.identity+" to have been called with "+jasmine.pp(expectedArgs)+" but it was never called.",
"Expected spy "+this.actual.identity+" not to have been called with "+jasmine.pp(expectedArgs)+" but it was."
];
}else{
return[
"Expected spy "+this.actual.identity+" to have been called with "+jasmine.pp(expectedArgs)+" but was called with "+jasmine.pp(this.actual.argsForCall),
"Expected spy "+this.actual.identity+" not to have been called with "+jasmine.pp(expectedArgs)+" but was called with "+jasmine.pp(this.actual.argsForCall)
mismatchValues.push("'"+property+"' was '"+(other[property]?jasmine.util.htmlEscape(other[property].toString()):other[property])+"' in expected, but was '"+(this.sample[property]?jasmine.util.htmlEscape(this.sample[property].toString()):this.sample[property])+"' in actual.");