Sha256: 510ed6f0a41040f6cbba115f12d1eea54613ea1bfc03ed5a2987b4bf8ea79301

Contents?: true

Size: 975 Bytes

Versions: 98

Compression:

Stored size: 975 Bytes

Contents

// This file defines global helper functions for specs
//
// js specs are intended to be run with the mozilla js standalone lib:
// http://www.ossp.org/pkg/lib/js/
//
// Output is intended to be used in a html wrapper, as in TextMate.

// The tester function.
//
it = function(should, callback) {
  var result = callback();
  if (result) {
    print('.');
  } else {
    print('F - was not ' + should + ' : ' + callback);
  };
};

// For defining a context.
//
context = function(description, setup, specs, breakdown) {
  var old_description = this.context_description;
  var pre_description = old_description ? old_description + ' ' : '';

  // framework setup
  this.context_description = pre_description + description; // sets the description on the global object
  
  if (setup)     { setup(); };
  specs();
  if (breakdown) { breakdown(); };

  // framework breakdown
  this.context_description = old_description;
};

// Alias describe to context.
//
describe = context;

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
picky-client-4.31.3 javascripts/spec_helper.js
picky-client-4.31.2 javascripts/spec_helper.js
picky-client-4.31.1 javascripts/spec_helper.js
picky-client-4.31.0 javascripts/spec_helper.js
picky-client-4.30.0 javascripts/spec_helper.js
picky-client-4.29.0 javascripts/spec_helper.js
picky-client-4.28.1 javascripts/spec_helper.js
picky-client-4.27.1 javascripts/spec_helper.js
picky-client-4.27.0 javascripts/spec_helper.js
picky-client-4.26.2 javascripts/spec_helper.js
picky-client-4.26.1 javascripts/spec_helper.js
picky-client-4.26.0 javascripts/spec_helper.js
picky-client-4.25.3 javascripts/spec_helper.js
picky-client-4.25.2 javascripts/spec_helper.js
picky-client-4.25.1 javascripts/spec_helper.js
picky-client-4.25.0 javascripts/spec_helper.js
picky-client-4.24.0 javascripts/spec_helper.js
picky-client-4.23.2 javascripts/spec_helper.js
picky-client-4.23.1 javascripts/spec_helper.js
picky-client-4.23.0 javascripts/spec_helper.js