Sha256: 299e92fda645bbcedd34a53f1dc39e3b34c9316a3883751ba2f8e27eb813dde2
Contents?: true
Size: 1.05 KB
Versions: 40
Compression:
Stored size: 1.05 KB
Contents
getJasmineRequireObj().SpyStrategy = function() { function SpyStrategy(options) { options = options || {}; var identity = options.name || 'unknown', originalFn = options.fn || function() {}, getSpy = options.getSpy || function() {}, plan = function() {}; this.identity = function() { return identity; }; this.exec = function() { return plan.apply(this, arguments); }; this.callThrough = function() { plan = originalFn; return getSpy(); }; this.returnValue = function(value) { plan = function() { return value; }; return getSpy(); }; this.throwError = function(something) { var error = (something instanceof Error) ? something : new Error(something); plan = function() { throw error; }; return getSpy(); }; this.callFake = function(fn) { plan = fn; return getSpy(); }; this.stub = function(fn) { plan = function() {}; return getSpy(); }; } return SpyStrategy; };
Version data entries
40 entries across 40 versions & 2 rubygems