Sha256: db5a09b9ce337f0b83dcc6434b319f1e259500c4c5d36c609fbd0cc97ed26aba

Contents?: true

Size: 569 Bytes

Versions: 3

Compression:

Stored size: 569 Bytes

Contents

function QSpec(context) {
	this.context = context;
	this.tests = [];
	this.before = function() {};
	this.after = function() {};
}

QSpec.prototype.run_all = function() {
	var slf = this;
	
	if (this.context !== undefined && typeof this.context === 'string') {
		module(this.context);
	}
	
	var length = this.tests.length;
	
	for (var i = 0; i < length; i++) {
		this.before();
		test(this.tests[i].spec, this.tests[i].assertions); 
		this.after();
	}
};

QSpec.prototype.should = function(spec, assertions) {
	this.tests.push({ spec: spec, assertions: assertions });
};

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ninjs-0.16.0 repository/ninjs/tests/qspec.js
ninjs-0.14.1 repository/ninjs/tests/qspec.js
ninjs-0.14.0 repository/ninjs/tests/qspec.js