vendor/assets/libs/jasmine/jasmine.js in test_squad-0.0.1 vs vendor/assets/libs/jasmine/jasmine.js in test_squad-0.1.0
- old
+ new
@@ -1,7 +1,7 @@
/*
-Copyright (c) 2008-2014 Pivotal Labs
+Copyright (c) 2008-2015 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
@@ -18,17 +18,20 @@
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-getJasmineRequireObj = (function (jasmineGlobal) {
+var getJasmineRequireObj = (function (jasmineGlobal) {
var jasmineRequire;
if (typeof module !== 'undefined' && module.exports) {
jasmineGlobal = global;
jasmineRequire = exports;
} else {
+ if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') {
+ jasmineGlobal = window;
+ }
jasmineRequire = jasmineGlobal.jasmineRequire = jasmineGlobal.jasmineRequire || {};
}
function getJasmineRequire() {
return jasmineRequire;
@@ -38,10 +41,11 @@
var j$ = {};
jRequire.base(j$, jasmineGlobal);
j$.util = jRequire.util();
j$.Any = jRequire.Any();
+ j$.Anything = jRequire.Anything(j$);
j$.CallTracker = jRequire.CallTracker();
j$.MockDate = jRequire.MockDate();
j$.Clock = jRequire.Clock();
j$.DelayedFunctionScheduler = jRequire.DelayedFunctionScheduler();
j$.Env = jRequire.Env(j$);
@@ -49,16 +53,18 @@
j$.Expectation = jRequire.Expectation();
j$.buildExpectationResult = jRequire.buildExpectationResult();
j$.JsApiReporter = jRequire.JsApiReporter();
j$.matchersUtil = jRequire.matchersUtil(j$);
j$.ObjectContaining = jRequire.ObjectContaining(j$);
+ j$.ArrayContaining = jRequire.ArrayContaining(j$);
j$.pp = jRequire.pp(j$);
j$.QueueRunner = jRequire.QueueRunner(j$);
j$.ReportDispatcher = jRequire.ReportDispatcher();
j$.Spec = jRequire.Spec(j$);
j$.SpyRegistry = jRequire.SpyRegistry(j$);
j$.SpyStrategy = jRequire.SpyStrategy();
+ j$.StringMatching = jRequire.StringMatching(j$);
j$.Suite = jRequire.Suite();
j$.Timer = jRequire.Timer();
j$.version = jRequire.version();
j$.matchers = jRequire.requireMatchers(jRequire, j$);
@@ -136,18 +142,34 @@
j$.isDomNode = function(obj) {
return obj.nodeType > 0;
};
+ j$.fnNameFor = function(func) {
+ return func.name || func.toString().match(/^\s*function\s*(\w*)\s*\(/)[1];
+ };
+
j$.any = function(clazz) {
return new j$.Any(clazz);
};
+ j$.anything = function() {
+ return new j$.Anything();
+ };
+
j$.objectContaining = function(sample) {
return new j$.ObjectContaining(sample);
};
+ j$.stringMatching = function(expected) {
+ return new j$.StringMatching(expected);
+ };
+
+ j$.arrayContaining = function(sample) {
+ return new j$.ArrayContaining(sample);
+ };
+
j$.createSpy = function(name, originalFn) {
var spyStrategy = new j$.SpyStrategy({
name: name,
fn: originalFn,
@@ -188,10 +210,15 @@
return putativeSpy.and instanceof j$.SpyStrategy &&
putativeSpy.calls instanceof j$.CallTracker;
};
j$.createSpyObj = function(baseName, methodNames) {
+ if (j$.isArray_(baseName) && j$.util.isUndefined(methodNames)) {
+ methodNames = baseName;
+ baseName = 'unknown';
+ }
+
if (!j$.isArray_(methodNames) || methodNames.length === 0) {
throw 'createSpyObj requires a non-empty array of method names to create spies for';
}
var obj = {};
for (var i = 0; i < methodNames.length; i++) {
@@ -283,11 +310,12 @@
this.result = {
id: this.id,
description: this.description,
fullName: this.getFullName(),
failedExpectations: [],
- passedExpectations: []
+ passedExpectations: [],
+ pendingReason: ''
};
}
Spec.prototype.addExpectationResult = function(passed, data) {
var expectationResult = this.expectationResultFactory(data);
@@ -332,11 +360,11 @@
}
};
Spec.prototype.onException = function onException(e) {
if (Spec.isPendingSpecException(e)) {
- this.pend();
+ this.pend(extractCustomPendingMessage(e));
return;
}
this.addExpectationResult(false, {
matcherName: '',
@@ -349,12 +377,15 @@
Spec.prototype.disable = function() {
this.disabled = true;
};
- Spec.prototype.pend = function() {
+ Spec.prototype.pend = function(message) {
this.markedPending = true;
+ if (message) {
+ this.result.pendingReason = message;
+ }
};
Spec.prototype.status = function() {
if (this.disabled) {
return 'disabled';
@@ -377,10 +408,18 @@
Spec.prototype.getFullName = function() {
return this.getSpecName(this);
};
+ var extractCustomPendingMessage = function(e) {
+ var fullMessage = e.toString(),
+ boilerplateStart = fullMessage.indexOf(Spec.pendingSpecExceptionMessage),
+ boilerplateEnd = boilerplateStart + Spec.pendingSpecExceptionMessage.length;
+
+ return fullMessage.substr(boilerplateEnd);
+ };
+
Spec.pendingSpecExceptionMessage = '=> marked Pending';
Spec.isPendingSpecException = function(e) {
return !!(e && e.toString && e.toString().indexOf(Spec.pendingSpecExceptionMessage) !== -1);
};
@@ -629,15 +668,16 @@
parentSuite: currentDeclarationSuite,
queueRunner: queueRunnerFactory,
onStart: suiteStarted,
expectationFactory: expectationFactory,
expectationResultFactory: expectationResultFactory,
+ runnablesExplictlySetGetter: runnablesExplictlySetGetter,
resultCallback: function(attrs) {
if (!suite.disabled) {
clearResourcesForRunnable(suite.id);
- currentlyExecutingSuites.pop();
}
+ currentlyExecutingSuites.pop();
reporter.suiteDone(attrs);
}
});
runnableLookupTable[suite.id] = suite;
@@ -821,12 +861,16 @@
fn: afterAllFunction,
timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; }
});
};
- this.pending = function() {
- throw j$.Spec.pendingSpecExceptionMessage;
+ this.pending = function(message) {
+ var fullMessage = j$.Spec.pendingSpecExceptionMessage;
+ if(message) {
+ fullMessage += message;
+ }
+ throw fullMessage;
};
this.fail = function(error) {
var message = 'Failed';
if (error) {
@@ -837,11 +881,12 @@
currentRunnable().addExpectationResult(false, {
matcherName: '',
passed: false,
expected: '',
actual: '',
- message: message
+ message: message,
+ error: error && error.message ? error : null
});
};
}
return Env;
@@ -924,47 +969,10 @@
}
return JsApiReporter;
};
-getJasmineRequireObj().Any = function() {
-
- function Any(expectedObject) {
- this.expectedObject = expectedObject;
- }
-
- Any.prototype.jasmineMatches = function(other) {
- if (this.expectedObject == String) {
- return typeof other == 'string' || other instanceof String;
- }
-
- if (this.expectedObject == Number) {
- return typeof other == 'number' || other instanceof Number;
- }
-
- if (this.expectedObject == Function) {
- return typeof other == 'function' || other instanceof Function;
- }
-
- if (this.expectedObject == Object) {
- return typeof other == 'object';
- }
-
- if (this.expectedObject == Boolean) {
- return typeof other == 'boolean';
- }
-
- return other instanceof this.expectedObject;
- };
-
- Any.prototype.jasmineToString = function() {
- return '<jasmine.any(' + this.expectedObject + ')>';
- };
-
- return Any;
-};
-
getJasmineRequireObj().CallTracker = function() {
function CallTracker() {
var calls = [];
@@ -1242,10 +1250,16 @@
true,
scheduledFn.timeoutKey,
scheduledFn.runAtMillis + scheduledFn.millis);
}
+ function forEachFunction(funcsToRun, callback) {
+ for (var i = 0; i < funcsToRun.length; ++i) {
+ callback(funcsToRun[i]);
+ }
+ }
+
function runScheduledFunctions(endTime) {
if (scheduledLookup.length === 0 || scheduledLookup[0] > endTime) {
return;
}
@@ -1253,19 +1267,19 @@
currentTime = scheduledLookup.shift();
var funcsToRun = scheduledFunctions[currentTime];
delete scheduledFunctions[currentTime];
- for (var i = 0; i < funcsToRun.length; ++i) {
- var funcToRun = funcsToRun[i];
-
+ forEachFunction(funcsToRun, function(funcToRun) {
if (funcToRun.recurring) {
reschedule(funcToRun);
}
+ });
+ forEachFunction(funcsToRun, function(funcToRun) {
funcToRun.funcToCall.apply(null, funcToRun.params || []);
- }
+ });
} while (scheduledLookup.length > 0 &&
// checking first if we're out of time prevents setTimeout(0)
// scheduled in a funcToRun from forcing an extra iteration
currentTime !== endTime &&
scheduledLookup[0] <= endTime);
@@ -1504,11 +1518,11 @@
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
arguments[4]);
case 6:
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
arguments[4], arguments[5]);
- case 7:
+ default:
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
arguments[4], arguments[5], arguments[6]);
}
}
@@ -1531,45 +1545,10 @@
}
return MockDate;
};
-getJasmineRequireObj().ObjectContaining = function(j$) {
-
- function ObjectContaining(sample) {
- this.sample = sample;
- }
-
- ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) {
- if (typeof(this.sample) !== 'object') { throw new Error('You must provide an object to objectContaining, not \''+this.sample+'\'.'); }
-
- mismatchKeys = mismatchKeys || [];
- mismatchValues = mismatchValues || [];
-
- var hasKey = function(obj, keyName) {
- return obj !== null && !j$.util.isUndefined(obj[keyName]);
- };
-
- for (var property in this.sample) {
- if (!hasKey(other, property) && hasKey(this.sample, property)) {
- mismatchKeys.push('expected has key \'' + property + '\', but missing from actual.');
- }
- else if (!j$.matchersUtil.equals(other[property], this.sample[property])) {
- mismatchValues.push('\'' + property + '\' was \'' + (other[property] ? j$.util.htmlEscape(other[property].toString()) : other[property]) + '\' in actual, but was \'' + (this.sample[property] ? j$.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + '\' in expected.');
- }
- }
-
- return (mismatchKeys.length === 0 && mismatchValues.length === 0);
- };
-
- ObjectContaining.prototype.jasmineToString = function() {
- return '<jasmine.objectContaining(' + j$.pp(this.sample) + ')>';
- };
-
- return ObjectContaining;
-};
-
getJasmineRequireObj().pp = function(j$) {
function PrettyPrinter() {
this.ppNestLevel_ = 0;
this.seen = [];
@@ -1665,17 +1644,19 @@
}
this.append(' ]');
};
StringPrettyPrinter.prototype.emitObject = function(obj) {
+ var constructorName = obj.constructor ? j$.fnNameFor(obj.constructor) : 'null';
+ this.append(constructorName);
+
if (this.ppNestLevel_ > j$.MAX_PRETTY_PRINT_DEPTH) {
- this.append('Object');
return;
}
var self = this;
- this.append('{ ');
+ this.append('({ ');
var first = true;
this.iterateObject(obj, function(property, isGetter) {
if (first) {
first = false;
@@ -1690,11 +1671,11 @@
} else {
self.format(obj[property]);
}
});
- this.append(' }');
+ this.append(' })');
};
StringPrettyPrinter.prototype.append = function(value) {
this.string += value;
};
@@ -1740,11 +1721,12 @@
for(iterativeIndex = recursiveIndex; iterativeIndex < length; iterativeIndex++) {
var queueableFn = queueableFns[iterativeIndex];
if (queueableFn.fn.length > 0) {
- return attemptAsync(queueableFn);
+ attemptAsync(queueableFn);
+ return;
} else {
attemptSync(queueableFn);
}
}
@@ -1855,10 +1837,14 @@
this.spyOn = function(obj, methodName) {
if (j$.util.isUndefined(obj)) {
throw new Error('spyOn could not find an object to spy upon for ' + methodName + '()');
}
+ if (j$.util.isUndefined(methodName)) {
+ throw new Error('No method name supplied');
+ }
+
if (j$.util.isUndefined(obj[methodName])) {
throw new Error(methodName + '() method does not exist');
}
if (obj[methodName] && j$.isSpy(obj[methodName])) {
@@ -1961,10 +1947,11 @@
this.onStart = attrs.onStart || function() {};
this.resultCallback = attrs.resultCallback || function() {};
this.clearStack = attrs.clearStack || function(fn) {fn();};
this.expectationFactory = attrs.expectationFactory;
this.expectationResultFactory = attrs.expectationResultFactory;
+ this.runnablesExplictlySetGetter = attrs.runnablesExplictlySetGetter || function() {};
this.beforeFns = [];
this.afterFns = [];
this.beforeAllFns = [];
this.afterAllFns = [];
@@ -2072,18 +2059,12 @@
return { fn: function(done) { child.execute(done); } };
}
};
Suite.prototype.isExecutable = function() {
- var foundActive = false;
- for(var i = 0; i < this.children.length; i++) {
- if(this.children[i].isExecutable()) {
- foundActive = true;
- break;
- }
- }
- return foundActive;
+ var runnablesExplicitlySet = this.runnablesExplictlySetGetter();
+ return !runnablesExplicitlySet && hasExecutableChild(this.children);
};
Suite.prototype.sharedUserContext = function() {
if (!this.sharedContext) {
this.sharedContext = this.parentSuite ? clone(this.parentSuite.sharedUserContext()) : {};
@@ -2132,10 +2113,21 @@
function isFailure(args) {
return !args[0];
}
+ function hasExecutableChild(children) {
+ var foundActive = false;
+ for (var i = 0; i < children.length; i++) {
+ if (children[i].isExecutable()) {
+ foundActive = true;
+ break;
+ }
+ }
+ return foundActive;
+ }
+
function clone(obj) {
var clonedObj = {};
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
clonedObj[prop] = obj[prop];
@@ -2173,10 +2165,135 @@
}
return Timer;
};
+getJasmineRequireObj().Any = function() {
+
+ function Any(expectedObject) {
+ this.expectedObject = expectedObject;
+ }
+
+ Any.prototype.asymmetricMatch = function(other) {
+ if (this.expectedObject == String) {
+ return typeof other == 'string' || other instanceof String;
+ }
+
+ if (this.expectedObject == Number) {
+ return typeof other == 'number' || other instanceof Number;
+ }
+
+ if (this.expectedObject == Function) {
+ return typeof other == 'function' || other instanceof Function;
+ }
+
+ if (this.expectedObject == Object) {
+ return typeof other == 'object';
+ }
+
+ if (this.expectedObject == Boolean) {
+ return typeof other == 'boolean';
+ }
+
+ return other instanceof this.expectedObject;
+ };
+
+ Any.prototype.jasmineToString = function() {
+ return '<jasmine.any(' + this.expectedObject + ')>';
+ };
+
+ return Any;
+};
+
+getJasmineRequireObj().Anything = function(j$) {
+
+ function Anything() {}
+
+ Anything.prototype.asymmetricMatch = function(other) {
+ return !j$.util.isUndefined(other) && other !== null;
+ };
+
+ Anything.prototype.jasmineToString = function() {
+ return '<jasmine.anything>';
+ };
+
+ return Anything;
+};
+
+getJasmineRequireObj().ArrayContaining = function(j$) {
+ function ArrayContaining(sample) {
+ this.sample = sample;
+ }
+
+ ArrayContaining.prototype.asymmetricMatch = function(other) {
+ var className = Object.prototype.toString.call(this.sample);
+ if (className !== '[object Array]') { throw new Error('You must provide an array to arrayContaining, not \'' + this.sample + '\'.'); }
+
+ for (var i = 0; i < this.sample.length; i++) {
+ var item = this.sample[i];
+ if (!j$.matchersUtil.contains(other, item)) {
+ return false;
+ }
+ }
+
+ return true;
+ };
+
+ ArrayContaining.prototype.jasmineToString = function () {
+ return '<jasmine.arrayContaining(' + jasmine.pp(this.sample) +')>';
+ };
+
+ return ArrayContaining;
+};
+
+getJasmineRequireObj().ObjectContaining = function(j$) {
+
+ function ObjectContaining(sample) {
+ this.sample = sample;
+ }
+
+ ObjectContaining.prototype.asymmetricMatch = function(other) {
+ if (typeof(this.sample) !== 'object') { throw new Error('You must provide an object to objectContaining, not \''+this.sample+'\'.'); }
+
+ for (var property in this.sample) {
+ if (!Object.prototype.hasOwnProperty.call(other, property) ||
+ !j$.matchersUtil.equals(this.sample[property], other[property])) {
+ return false;
+ }
+ }
+
+ return true;
+ };
+
+ ObjectContaining.prototype.jasmineToString = function() {
+ return '<jasmine.objectContaining(' + j$.pp(this.sample) + ')>';
+ };
+
+ return ObjectContaining;
+};
+
+getJasmineRequireObj().StringMatching = function(j$) {
+
+ function StringMatching(expected) {
+ if (!j$.isString_(expected) && !j$.isA_('RegExp', expected)) {
+ throw new Error('Expected is not a String or a RegExp');
+ }
+
+ this.regexp = new RegExp(expected);
+ }
+
+ StringMatching.prototype.asymmetricMatch = function(other) {
+ return this.regexp.test(other);
+ };
+
+ StringMatching.prototype.jasmineToString = function() {
+ return '<jasmine.stringMatching(' + this.regexp + ')>';
+ };
+
+ return StringMatching;
+};
+
getJasmineRequireObj().matchersUtil = function(j$) {
// TODO: what to do about jasmine.pp not being inject? move to JSON.stringify? gut PrettyPrinter?
return {
equals: function(a, b, customTesters) {
@@ -2226,43 +2343,48 @@
return message + '.';
}
};
+ function isAsymmetric(obj) {
+ return obj && j$.isA_('Function', obj.asymmetricMatch);
+ }
+
+ function asymmetricMatch(a, b) {
+ var asymmetricA = isAsymmetric(a),
+ asymmetricB = isAsymmetric(b);
+
+ if (asymmetricA && asymmetricB) {
+ return undefined;
+ }
+
+ if (asymmetricA) {
+ return a.asymmetricMatch(b);
+ }
+
+ if (asymmetricB) {
+ return b.asymmetricMatch(a);
+ }
+ }
+
// Equality function lovingly adapted from isEqual in
// [Underscore](http://underscorejs.org)
function eq(a, b, aStack, bStack, customTesters) {
var result = true;
+ var asymmetricResult = asymmetricMatch(a, b);
+ if (!j$.util.isUndefined(asymmetricResult)) {
+ return asymmetricResult;
+ }
+
for (var i = 0; i < customTesters.length; i++) {
var customTesterResult = customTesters[i](a, b);
if (!j$.util.isUndefined(customTesterResult)) {
return customTesterResult;
}
}
- if (a instanceof j$.Any) {
- result = a.jasmineMatches(b);
- if (result) {
- return true;
- }
- }
-
- if (b instanceof j$.Any) {
- result = b.jasmineMatches(a);
- if (result) {
- return true;
- }
- }
-
- if (b instanceof j$.ObjectContaining) {
- result = b.jasmineMatches(a);
- if (result) {
- return true;
- }
- }
-
if (a instanceof Error && b instanceof Error) {
return a.message == b.message;
}
// Identical objects are equal. `0 === -0`, but they aren't identical.
@@ -2294,10 +2416,33 @@
a.global == b.global &&
a.multiline == b.multiline &&
a.ignoreCase == b.ignoreCase;
}
if (typeof a != 'object' || typeof b != 'object') { return false; }
+
+ var aIsDomNode = j$.isDomNode(a);
+ var bIsDomNode = j$.isDomNode(b);
+ if (aIsDomNode && bIsDomNode) {
+ // At first try to use DOM3 method isEqualNode
+ if (a.isEqualNode) {
+ return a.isEqualNode(b);
+ }
+ // IE8 doesn't support isEqualNode, try to use outerHTML && innerText
+ var aIsElement = a instanceof Element;
+ var bIsElement = b instanceof Element;
+ if (aIsElement && bIsElement) {
+ return a.outerHTML == b.outerHTML;
+ }
+ if (aIsElement || bIsElement) {
+ return false;
+ }
+ return a.innerText == b.innerText && a.textContent == b.textContent;
+ }
+ if (aIsDomNode || bIsDomNode) {
+ return false;
+ }
+
// Assume equality for cyclic structures. The algorithm for detecting cyclic
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
var length = aStack.length;
while (length--) {
// Linear search. Performance is inversely proportional to the number of
@@ -2307,21 +2452,16 @@
// Add the first object to the stack of traversed objects.
aStack.push(a);
bStack.push(b);
var size = 0;
// Recursively compare objects and arrays.
- if (className == '[object Array]') {
- // Compare array lengths to determine if a deep comparison is necessary.
- size = a.length;
- result = size == b.length;
- if (result) {
- // Deep compare the contents, ignoring non-numeric properties.
- while (size--) {
- if (!(result = eq(a[size], b[size], aStack, bStack, customTesters))) { break; }
- }
- }
- } else {
+ // Compare array lengths to determine if a deep comparison is necessary.
+ if (className == '[object Array]' && a.length !== b.length) {
+ result = false;
+ }
+
+ if (result) {
// Objects with different constructors are not equivalent, but `Object`s
// from different frames are.
var aCtor = a.constructor, bCtor = b.constructor;
if (aCtor !== bCtor && !(isFunction(aCtor) && (aCtor instanceof aCtor) &&
isFunction(bCtor) && (bCtor instanceof bCtor))) {
@@ -2349,11 +2489,11 @@
bStack.pop();
return result;
function has(obj, key) {
- return obj.hasOwnProperty(key);
+ return Object.prototype.hasOwnProperty.call(obj, key);
}
function isFunction(obj) {
return typeof obj === 'function';
}
@@ -2618,15 +2758,19 @@
}
return toHaveBeenCalledWith;
};
-getJasmineRequireObj().toMatch = function() {
+getJasmineRequireObj().toMatch = function(j$) {
function toMatch() {
return {
compare: function(actual, expected) {
+ if (!j$.isString_(expected) && !j$.isA_('RegExp', expected)) {
+ throw new Error('Expected is not a String or a RegExp');
+ }
+
var regexp = new RegExp(expected);
return {
pass: regexp.test(actual)
};
@@ -2715,11 +2859,11 @@
fail.message = function() { return 'Expected function to throw an Error, but it threw ' + j$.pp(thrown) + '.'; };
return fail;
}
if (errorMatcher.hasNoSpecifics()) {
- pass.message = 'Expected function not to throw an Error, but it threw ' + fnNameFor(thrown) + '.';
+ pass.message = 'Expected function not to throw an Error, but it threw ' + j$.fnNameFor(thrown) + '.';
return pass;
}
if (errorMatcher.matches(thrown)) {
pass.message = function() {
@@ -2769,13 +2913,13 @@
return expected.test(message);
}
}
return {
- errorTypeDescription: errorType ? fnNameFor(errorType) : 'an exception',
+ errorTypeDescription: errorType ? j$.fnNameFor(errorType) : 'an exception',
thrownDescription: function(thrown) {
- var thrownName = errorType ? fnNameFor(thrown.constructor) : 'an exception',
+ var thrownName = errorType ? j$.fnNameFor(thrown.constructor) : 'an exception',
thrownMessage = '';
if (expected) {
thrownMessage = ' with message ' + j$.pp(thrown.message);
}
@@ -2799,14 +2943,10 @@
(expected === null || messageMatch(error.message));
}
};
}
- function fnNameFor(func) {
- return func.name || func.toString().match(/^\s*function\s*(\w*)\s*\(/)[1];
- }
-
function isStringOrRegExp(potential) {
return potential instanceof RegExp || (typeof potential == 'string');
}
function isAnErrorType(type) {
@@ -2835,44 +2975,44 @@
fdescribe: function(description, specDefinitions) {
return env.fdescribe(description, specDefinitions);
},
- it: function(desc, func) {
- return env.it(desc, func);
+ it: function() {
+ return env.it.apply(env, arguments);
},
- xit: function(desc, func) {
- return env.xit(desc, func);
+ xit: function() {
+ return env.xit.apply(env, arguments);
},
- fit: function(desc, func) {
- return env.fit(desc, func);
+ fit: function() {
+ return env.fit.apply(env, arguments);
},
- beforeEach: function(beforeEachFunction) {
- return env.beforeEach(beforeEachFunction);
+ beforeEach: function() {
+ return env.beforeEach.apply(env, arguments);
},
- afterEach: function(afterEachFunction) {
- return env.afterEach(afterEachFunction);
+ afterEach: function() {
+ return env.afterEach.apply(env, arguments);
},
- beforeAll: function(beforeAllFunction) {
- return env.beforeAll(beforeAllFunction);
+ beforeAll: function() {
+ return env.beforeAll.apply(env, arguments);
},
- afterAll: function(afterAllFunction) {
- return env.afterAll(afterAllFunction);
+ afterAll: function() {
+ return env.afterAll.apply(env, arguments);
},
expect: function(actual) {
return env.expect(actual);
},
pending: function() {
- return env.pending();
+ return env.pending.apply(env, arguments);
},
fail: function() {
return env.fail.apply(env, arguments);
},
@@ -2902,7 +3042,7 @@
return jasmineInterface;
};
getJasmineRequireObj().version = function() {
- return '2.1.3';
+ return '2.2.0';
};