Sha256: 25a02911071c45fb6af35d33b5b9f970bd8a093a64304310412e3c516c8664d3

Contents?: true

Size: 1.46 KB

Versions: 8

Compression:

Stored size: 1.46 KB

Contents

/**
 * Runner
 *
 * @constructor
 * @param {jasmine.Env} env
 */
jasmine.Runner = function(env) {
  var self = this;
  self.env = env;
  self.queue = new jasmine.Queue(env);
  self.before_ = [];
  self.after_ = [];
  self.suites_ = [];
};

jasmine.Runner.prototype.execute = function() {
  var self = this;
  if (self.env.reporter.reportRunnerStarting) {
    self.env.reporter.reportRunnerStarting(this);
  }
  self.queue.start(function () {
    self.finishCallback();
  });
};

jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
  beforeEachFunction.typeName = 'beforeEach';
  this.before_.push(beforeEachFunction);
};

jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
  afterEachFunction.typeName = 'afterEach';
  this.after_.push(afterEachFunction);
};


jasmine.Runner.prototype.finishCallback = function() {
  this.env.reporter.reportRunnerResults(this);
};

jasmine.Runner.prototype.addSuite = function(suite) {
  this.suites_.push(suite);
};

jasmine.Runner.prototype.add = function(block) {
  if (block instanceof jasmine.Suite) {
    this.addSuite(block);
  }
  this.queue.add(block);
};

jasmine.Runner.prototype.specs = function () {
  var suites = this.suites();
  var specs = [];
  for (var i = 0; i < suites.length; i++) {
    specs = specs.concat(suites[i].specs());
  }
  return specs;
};


jasmine.Runner.prototype.suites = function() {
  return this.suites_;
};

jasmine.Runner.prototype.results = function() {
  return this.queue.results();
};

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
jasnode-0.4.3.0 jasmine/src/Runner.js
jasnode-0.4.2.0 jasmine/src/Runner.js
jasnode-0.4.1.0 jasmine/src/Runner.js
jasnode-0.4.0.0 jasmine/src/Runner.js
jasnode-0.2.0.0 jasmine/src/Runner.js
jazz-0.1.1 vendor/jasmine/src/Runner.js
jazrb-0.1.1 vendor/jasmine/src/Runner.js
jazrb-0.1.0 vendor/jasmine/src/Runner.js