spec/dummy/tmp/cache/assets/DF6/0E0/sprockets%2F85b10db6e1afe643aba6d396abdd77f0 in teabag-0.3.5 vs spec/dummy/tmp/cache/assets/DF6/0E0/sprockets%2F85b10db6e1afe643aba6d396abdd77f0 in teabag-0.3.6

- old
+ new

@@ -1,8 +1,8 @@ -o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1356062005.762387: @value"::{I" +o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1356388025.2065961: @value"©:{I" class:EFI"BundledAsset;FI"logical_path;FI"teabag/mocha.js;FI" pathname;FI"P/Users/jejacks0n/Projects/teabag/app/assets/javascripts/teabag/mocha.coffee;FI"content_type;FI"application/javascript;FI" -mtime;FI"2012-12-20T18:59:53-07:00;FI" length;Fih8I" digest;F"%5cf9d7a97d1a233e06e24fa4163baad2I" source;FI"h8;(function(){ +mtime;FI"2012-12-24T15:26:57-07:00;FI" length;Fi×8I" digest;F"%173149542febc4e68d1e9615ce44f32fI" source;FI"×8;(function(){ // CommonJS require() function require(p){ @@ -5019,18 +5019,33 @@ Teabag.location = window.location; Teabag.console = window.console; + Teabag.messages = []; + Teabag.execute = function() { if (this.defer) { this.defer = false; return; } return new Teabag.Runner(); }; + Teabag.log = function() { + var _ref; + this.messages.push(arguments[0]); + return (_ref = this.console).log.apply(_ref, arguments); + }; + + Teabag.getMessages = function() { + var messages; + messages = this.messages; + this.messages = []; + return messages; + }; + return Teabag; })(); }).call(this); @@ -5060,112 +5075,31 @@ params[decodeURIComponent(name)] = decodeURIComponent(value); } return params; }; - Runner.prototype.setup = function() {}; - - return Runner; - - })(); - -}).call(this); -(function() { - - Teabag.Reporters.NormalizedSpec = (function() { - - function NormalizedSpec(spec) { - var _base, _base1; - this.spec = spec; - this.fullDescription = (typeof (_base = this.spec).getFullName === "function" ? _base.getFullName() : void 0) || this.spec.fullTitle(); - this.description || (this.description = this.spec.description || this.spec.title); - this.link = "?grep=" + (encodeURIComponent(this.fullDescription)); - this.parent = this.spec.suite || this.spec.parent; - this.suiteName = (typeof (_base1 = this.parent).getFullName === "function" ? _base1.getFullName() : void 0) || this.parent.fullTitle(); - this.viewId = this.spec.viewId; - this.pending = this.spec.pending; - } - - NormalizedSpec.prototype.errors = function() { - var item, _i, _len, _ref, _results; - if (this.spec.err) { - return [this.spec.err]; - } - if (!this.spec.results) { - return []; - } - _ref = this.spec.results().getItems(); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - item = _ref[_i]; - if (item.passed()) { - continue; - } - _results.push({ - message: item.message, - stack: item.trace.stack - }); - } - return _results; - }; - - NormalizedSpec.prototype.result = function() { - var results, skipped, status; - status = "failed"; - if (this.spec.results) { - results = this.spec.results(); - if (results.passed()) { - status = "passed"; - } - skipped = results.skipped; + Runner.prototype.getReporter = function() { + if (this.params["reporter"]) { + return Teabag.Reporters[this.params["reporter"]]; } else { - if (this.spec.state === "passed" || this.spec.state === "skipped") { - status = "passed"; - } - skipped = this.spec.state === "skipped"; - } - if (this.spec.pending) { - status = "pending"; - } - return { - status: status, - skipped: skipped - }; - }; - - return NormalizedSpec; - - })(); - - Teabag.Reporters.NormalizedSuite = (function() { - - function NormalizedSuite(suite) { - var _base; - this.suite = suite; - this.fullDescription = (typeof (_base = this.suite).getFullName === "function" ? _base.getFullName() : void 0) || this.suite.fullTitle(); - this.description = this.suite.description || this.suite.title; - this.link = "?grep=" + (encodeURIComponent(this.fullDescription)); - this.parent = this.getParent(); - this.viewId = this.suite.viewId; - } - - NormalizedSuite.prototype.getParent = function() { - if (this.suite.parent) { - if (this.suite.parent.root) { - return null; + if (window.navigator.userAgent.match(/PhantomJS/)) { + return Teabag.Reporters.Console; } else { - return this.suite.parent; + return Teabag.Reporters.HTML; } - } else { - return this.suite.parentSuite; } }; - return NormalizedSuite; + Runner.prototype.setup = function() {}; + return Runner; + })(); +}).call(this); +(function() { + Teabag.Reporters.BaseView = (function() { function BaseView() { this.elements = {}; this.build(); @@ -5200,11 +5134,11 @@ }; BaseView.prototype.setText = function(id, value) { var el; el = this.findEl(id); - return el.innerText = value; + return el.innerHTML = value; }; BaseView.prototype.setHtml = function(id, value, add) { var el; if (add == null) { @@ -5235,97 +5169,10 @@ })(); }).call(this); (function() { - var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - Teabag.Reporters.Console = (function() { - - function Console() { - this.reportRunnerResults = __bind(this.reportRunnerResults, this); - this.start = new Teabag.Date().getTime(); - } - - Console.prototype.reportSpecResults = function(spec) { - var result; - this.spec = new Teabag.Reporters.NormalizedSpec(spec); - result = this.spec.result(); - switch (result.status) { - case "pending": - return this.trackPending(); - case "failed": - return this.trackFailure(); - default: - return this.log({ - type: "spec", - suite: this.spec.suiteName, - spec: this.spec.description, - status: result.status, - skipped: result.skipped, - full_description: this.spec.fullDescription - }); - } - }; - - Console.prototype.trackPending = function() { - var result; - result = this.spec.result(); - return this.log({ - type: "spec", - suite: this.spec.suiteName, - spec: this.spec.description, - status: result.status, - skipped: result.skipped, - full_description: this.spec.fullDescription - }); - }; - - Console.prototype.trackFailure = function() { - var error, result, _i, _len, _ref, _results; - result = this.spec.result(); - _ref = this.spec.errors(); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - error = _ref[_i]; - _results.push(this.log({ - type: "spec", - suite: this.spec.suiteName, - spec: this.spec.description, - status: result.status, - skipped: result.skipped, - full_description: this.spec.fullDescription, - link: this.spec.link, - message: error.message, - trace: error.stack || error.message || "Stack Trace Unavailable" - })); - } - return _results; - }; - - Console.prototype.reportRunnerResults = function() { - this.log({ - type: "results", - elapsed: ((new Teabag.Date().getTime() - this.start) / 1000).toFixed(5) - }); - return Teabag.finished = true; - }; - - Console.prototype.log = function(obj) { - if (obj == null) { - obj = {}; - } - obj["_teabag"] = true; - return Teabag.console.log(JSON.stringify(obj)); - }; - - return Console; - - })(); - -}).call(this); -(function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.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; }; Teabag.Reporters.HTML = (function(_super) { @@ -5386,11 +5233,11 @@ return this.setText("stats-duration", "..."); } }; HTML.prototype.reportSpecStarting = function(spec) { - spec = new Teabag.Reporters.NormalizedSpec(spec); + spec = new Teabag.Spec(spec); if (this.config["build-full-report"]) { this.reportView = new Teabag.Reporters.HTML.SpecView(spec, this); } return this.specStart = new Teabag.Date().getTime(); }; @@ -5430,11 +5277,11 @@ return this.setText("stats-" + name, value); }; HTML.prototype.updateStatus = function(spec) { var elapsed, result, _ref, _ref1; - spec = new Teabag.Reporters.NormalizedSpec(spec); + spec = new Teabag.Spec(spec); result = spec.result(); if (result.skipped || result.status === "pending") { this.updateStat("skipped", this.total.skipped += 1); return; } @@ -5514,11 +5361,11 @@ match = document.cookie.match(new RegExp("(?:^|;)\\s?" + name + "=(.*?)(?:;|$)", "i")); return match && JSON.parse(unescape(match[1]).split(" ")[0]); } else { date = new Teabag.Date(); date.setDate(date.getDate() + 365); - return document.cookie = "" + name + "=" + (escape(JSON.stringify(value))) + "; path=/; expires=" + (date.toUTCString()) + ";"; + return document.cookie = "" + name + "=" + (escape(JSON.stringify(value))) + "; path=\"/\"; expires=" + (date.toUTCString()) + ";"; } }; return HTML; @@ -5756,11 +5603,11 @@ this.suite = suite; this.reporter = reporter; this.views = this.reporter.views; this.suite.viewId = viewId += 1; this.views.suites[this.suite.viewId] = this; - this.suite = new Teabag.Reporters.NormalizedSuite(suite); + this.suite = new Teabag.Suite(suite); SuiteView.__super__.constructor.apply(this, arguments); } SuiteView.prototype.build = function() { SuiteView.__super__.build.call(this, "suite"); @@ -5806,10 +5653,123 @@ })(Teabag.Reporters.BaseView); }).call(this); (function() { + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + + Teabag.Reporters.Console = (function() { + + function Console() { + this.reportRunnerResults = __bind(this.reportRunnerResults, this); + this.start = new Teabag.Date(); + this.suites = {}; + } + + Console.prototype.reportRunnerStarting = function(runner) { + return this.log({ + type: "runner", + total: runner.total || runner.specs().length, + start: JSON.parse(JSON.stringify(this.start)) + }); + }; + + Console.prototype.reportSuites = function() { + var index, suite, _i, _len, _ref, _results; + _ref = this.spec.getParents(); + _results = []; + for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { + suite = _ref[index]; + if (this.suites[suite.fullDescription]) { + continue; + } + this.suites[suite.fullDescription] = true; + _results.push(this.log({ + type: "suite", + label: suite.description, + level: index + })); + } + return _results; + }; + + Console.prototype.reportSpecResults = function(spec) { + var result; + this.spec = new Teabag.Spec(spec); + result = this.spec.result(); + this.reportSuites(); + switch (result.status) { + case "pending": + return this.trackPending(); + case "failed": + return this.trackFailure(); + default: + return this.log({ + type: "spec", + suite: this.spec.suiteName, + label: this.spec.description, + status: result.status, + skipped: result.skipped + }); + } + }; + + Console.prototype.trackPending = function() { + var result; + result = this.spec.result(); + return this.log({ + type: "spec", + suite: this.spec.suiteName, + label: this.spec.description, + status: result.status, + skipped: result.skipped + }); + }; + + Console.prototype.trackFailure = function() { + var error, result, _i, _len, _ref, _results; + result = this.spec.result(); + _ref = this.spec.errors(); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + error = _ref[_i]; + _results.push(this.log({ + type: "spec", + suite: this.spec.suiteName, + label: this.spec.description, + status: result.status, + skipped: result.skipped, + link: this.spec.link, + message: error.message, + trace: error.stack || error.message || "Stack Trace Unavailable" + })); + } + return _results; + }; + + Console.prototype.reportRunnerResults = function() { + this.log({ + type: "result", + elapsed: ((new Teabag.Date().getTime() - this.start.getTime()) / 1000).toFixed(5) + }); + return Teabag.finished = true; + }; + + Console.prototype.log = function(obj) { + if (obj == null) { + obj = {}; + } + obj["_teabag"] = true; + return Teabag.log(JSON.stringify(obj)); + }; + + return Console; + + })(); + +}).call(this); +(function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.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; }; Teabag.Reporters.Console = (function(_super) { @@ -5817,19 +5777,19 @@ __extends(Console, _super); function Console(runner) { this.reportSpecResults = __bind(this.reportSpecResults, this); Console.__super__.constructor.apply(this, arguments); + this.reportRunnerStarting(runner); runner.on("fail", this.reportSpecResults); runner.on("test end", this.reportSpecResults); runner.on("end", this.reportRunnerResults); } Console.prototype.reportSpecResults = function(spec, err) { - this.spec = spec; if (err) { - this.spec.err = err; + spec.err = err; return; } return Console.__super__.reportSpecResults.apply(this, arguments); }; @@ -5907,22 +5867,87 @@ env.run(); } Runner.prototype.setup = function() { var reporter; - if (navigator.userAgent.match(/PhantomJS/)) { - reporter = Teabag.Reporters.Console; - } else { - reporter = Teabag.Reporters.HTML; - } + reporter = this.getReporter(); reporter.filter = this.params["grep"]; return env.setup({ reporter: reporter }); }; return Runner; })(Teabag.Runner); + Teabag.Spec = (function() { + + function Spec(spec) { + this.spec = spec; + this.fullDescription = this.spec.fullTitle(); + this.description = this.spec.title; + this.link = "?grep=" + (encodeURIComponent(this.fullDescription)); + this.parent = this.spec.parent; + this.suiteName = this.parent.fullTitle(); + this.viewId = this.spec.viewId; + this.pending = this.spec.pending; + } + + Spec.prototype.errors = function() { + if (!this.spec.err) { + return []; + } + return [this.spec.err]; + }; + + Spec.prototype.getParents = function() { + var parent; + if (this.parents) { + return this.parents; + } + this.parents || (this.parents = []); + parent = this.parent; + while (parent) { + parent = new Teabag.Suite(parent); + this.parents.unshift(parent); + parent = parent.parent; + } + return this.parents; + }; + + Spec.prototype.result = function() { + var status; + status = "failed"; + if (this.spec.state === "passed" || this.spec.state === "skipped") { + status = "passed"; + } + if (this.spec.pending) { + status = "pending"; + } + return { + status: status, + skipped: this.spec.state === "skipped" + }; + }; + + return Spec; + + })(); + + Teabag.Suite = (function() { + + function Suite(suite) { + this.suite = suite; + this.fullDescription = this.suite.fullTitle(); + this.description = this.suite.title; + this.link = "?grep=" + (encodeURIComponent(this.fullDescription)); + this.parent = this.suite.parent.root ? null : this.suite.parent; + this.viewId = this.suite.viewId; + } + + return Suite; + + })(); + }).call(this); -;TI"required_assets_digest;F"%a26f26f9ebf4baa4ce87ab6880ef8ad2I" _version;F"%6776f581a4329e299531e1d52aa59832 +;TI"required_assets_digest;F"%516059c14640659f993fd5032a38b89dI" _version;F"%6776f581a4329e299531e1d52aa59832 \ No newline at end of file