2011-12-29 23:37:23 +00:00
|
|
|
(function() {
|
|
|
|
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
|
|
|
|
|
2011-12-30 15:47:08 +00:00
|
|
|
jasmine.HeadlessReporter.Tap = (function() {
|
2011-12-29 23:37:23 +00:00
|
|
|
|
2011-12-30 15:47:08 +00:00
|
|
|
__extends(Tap, jasmine.HeadlessReporter);
|
2011-12-29 23:37:23 +00:00
|
|
|
|
2011-12-30 15:47:08 +00:00
|
|
|
function Tap(outputTarget) {
|
2011-12-29 23:37:23 +00:00
|
|
|
this.outputTarget = outputTarget != null ? outputTarget : null;
|
2011-12-30 15:47:08 +00:00
|
|
|
Tap.__super__.constructor.call(this, this.outputTarget);
|
2011-12-29 23:37:23 +00:00
|
|
|
this.output = [];
|
|
|
|
}
|
|
|
|
|
2011-12-30 15:47:08 +00:00
|
|
|
Tap.prototype.reportRunnerResults = function(runner) {
|
|
|
|
Tap.__super__.reportRunnerResults.call(this, runner);
|
2011-12-29 23:37:23 +00:00
|
|
|
if (this.output.length > 0) this.output.unshift("1.." + this.output.length);
|
|
|
|
return this.puts(this.output.join("\n"));
|
|
|
|
};
|
|
|
|
|
2011-12-30 15:47:08 +00:00
|
|
|
Tap.prototype.reportSpecResults = function(spec) {
|
2011-12-29 23:37:23 +00:00
|
|
|
var description, index;
|
|
|
|
var _this = this;
|
2011-12-30 15:47:08 +00:00
|
|
|
Tap.__super__.reportSpecResults.call(this, spec);
|
2011-12-29 23:37:23 +00:00
|
|
|
index = this.output.length + 1;
|
|
|
|
description = spec.getSpecSplitName().join(' ');
|
|
|
|
return this._reportSpecResult(spec, {
|
|
|
|
success: function(results) {
|
|
|
|
return _this.output.push("ok " + index + " " + description);
|
|
|
|
},
|
|
|
|
failure: function(results) {
|
|
|
|
return _this.output.push("not ok " + index + " " + description);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2011-12-30 15:47:08 +00:00
|
|
|
return Tap;
|
2011-12-29 23:37:23 +00:00
|
|
|
|
|
|
|
})();
|
|
|
|
|
|
|
|
}).call(this);
|