Sha256: ac4966601aad6f920fcd58c9948841e9e98699a1e9df373e7b00c0954b2023c4

Contents?: true

Size: 536 Bytes

Versions: 4

Compression:

Stored size: 536 Bytes

Contents

/**
 * Blocks are functions with executable code that make up a spec.
 *
 * @constructor
 * @param {jasmine.Env} env
 * @param {Function} func
 * @param {jasmine.Spec} spec
 */
jasmine.Block = function(env, func, spec) {
  this.env = env;
  this.func = func;
  this.spec = spec;
};

jasmine.Block.prototype.execute = function(onComplete) {
  if (!jasmine.CATCH_EXCEPTIONS) {
    this.func.apply(this.spec);
  }
  else {
    try {
      this.func.apply(this.spec);
    } catch (e) {
      this.spec.fail(e);
    }
  }
  onComplete();
};

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
evergreen-1.3.0 lib/jasmine/src/core/Block.js
evergreen-1.2.0 lib/jasmine/src/core/Block.js
evergreen-1.1.3 lib/jasmine/src/core/Block.js
evergreen-1.1.2 lib/jasmine/src/core/Block.js