{I" class:ETI"BundledAsset; FI"logical_path; TI"teaspoon-mocha.js; TI" pathname; TI"z/Users/Michael/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/teaspoon-0.8.0/app/assets/javascripts/teaspoon-mocha.js; FI"content_type; TI"application/javascript; TI" mtime; Tl+ï÷hSI"length; Ti¦I"digest; TI"%b68debcce102999934044a13081a3250; FI"source; TI"¦(function() { var __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; }; this.Teaspoon = (function() { function Teaspoon() {} Teaspoon.defer = false; Teaspoon.slow = 75; Teaspoon.root = window.location.pathname.replace(/\/+(index\.html)?$/, "").replace(/\/[^\/]*$/, ""); Teaspoon.started = false; Teaspoon.finished = false; Teaspoon.Reporters = {}; Teaspoon.Date = Date; Teaspoon.location = window.location; Teaspoon.messages = []; Teaspoon.execute = function() { if (Teaspoon.defer) { Teaspoon.defer = false; return; } if (Teaspoon.started) { Teaspoon.reload(); } Teaspoon.started = true; return new Teaspoon.Runner(); }; Teaspoon.reload = function() { return window.location.reload(); }; Teaspoon.onWindowLoad = function(method) { var originalOnload; originalOnload = window.onload; return window.onload = function() { if (originalOnload && originalOnload.call) { originalOnload(); } return method(); }; }; Teaspoon.resolveDependenciesFromParams = function(all) { var dep, deps, file, parts, path, paths, _i, _j, _len, _len1; if (all == null) { all = []; } deps = []; if ((paths = Teaspoon.location.search.match(/[\?&]file(\[\])?=[^&\?]*/gi)) === null) { return all; } for (_i = 0, _len = paths.length; _i < _len; _i++) { path = paths[_i]; parts = decodeURIComponent(path.replace(/\+/g, " ")).match(/\/(.+)\.(js|js.coffee|coffee)$/i); if (parts === null) { continue; } file = parts[1].substr(parts[1].lastIndexOf("/") + 1); for (_j = 0, _len1 = all.length; _j < _len1; _j++) { dep = all[_j]; if (dep.indexOf(file) >= 0) { deps.push(dep); } } } return deps; }; Teaspoon.log = function() { var e; Teaspoon.messages.push(arguments[0]); try { return console.log.apply(console, arguments); } catch (_error) { e = _error; throw new Error("Unable to use console.log for logging"); } }; Teaspoon.getMessages = function() { var messages; messages = Teaspoon.messages; Teaspoon.messages = []; return messages; }; return Teaspoon; })(); Teaspoon.Error = (function(_super) { __extends(Error, _super); function Error(message) { this.name = "TeaspoonError"; this.message = message || ""; } return Error; })(Error); }).call(this); (function() { Teaspoon.Runner = (function() { Runner.run = false; function Runner() { if (this.constructor.run) { return; } this.constructor.run = true; this.fixturePath = "" + Teaspoon.root + "/fixtures"; this.params = Teaspoon.params = this.getParams(); this.setup(); } Runner.prototype.getParams = function() { var name, param, params, value, _i, _len, _ref, _ref1; params = {}; _ref = Teaspoon.location.search.substring(1).split("&"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { param = _ref[_i]; _ref1 = param.split("="), name = _ref1[0], value = _ref1[1]; params[decodeURIComponent(name)] = decodeURIComponent(value); } return params; }; Runner.prototype.getReporter = function() { if (this.params["reporter"]) { return Teaspoon.Reporters[this.params["reporter"]]; } else { if (window.navigator.userAgent.match(/PhantomJS/)) { return Teaspoon.Reporters.Console; } else { return Teaspoon.Reporters.HTML; } } }; Runner.prototype.setup = function() {}; return Runner; })(); }).call(this); (function() { var __slice = [].slice; Teaspoon.fixture = (function() { var addContent, cleanup, create, load, loadComplete, preload, putContent, set, xhr, xhrRequest, _this = this; fixture.cache = {}; fixture.el = null; fixture.$el = null; fixture.json = []; fixture.preload = function() { var url, urls, _i, _len, _results; urls = 1 <= arguments.length ? __slice.call(arguments, 0) : []; _results = []; for (_i = 0, _len = urls.length; _i < _len; _i++) { url = urls[_i]; _results.push(preload(url)); } return _results; }; fixture.load = function() { var append, index, url, urls, _i, _j, _len, _results; urls = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), append = arguments[_i++]; if (append == null) { append = false; } if (typeof append !== "boolean") { urls.push(append); append = false; } _results = []; for (index = _j = 0, _len = urls.length; _j < _len; index = ++_j) { url = urls[index]; _results.push(load(url, append || index > 0)); } return _results; }; fixture.set = function() { var append, html, htmls, index, _i, _j, _len, _results; htmls = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), append = arguments[_i++]; if (append == null) { append = false; } if (typeof append !== "boolean") { htmls.push(append); append = false; } _results = []; for (index = _j = 0, _len = htmls.length; _j < _len; index = ++_j) { html = htmls[index]; _results.push(set(html, append || index > 0)); } return _results; }; fixture.cleanup = function() { return cleanup(); }; function fixture() { Teaspoon.fixture.load.apply(window, arguments); } xhr = null; preload = function(url) { return load(url, false, true); }; load = function(url, append, preload) { var cached, value; if (preload == null) { preload = false; } if (cached = Teaspoon.fixture.cache[url]) { return loadComplete(url, cached.type, cached.content, append, preload); } value = null; xhrRequest(url, function() { if (xhr.readyState !== 4) { return; } if (xhr.status !== 200) { throw "Unable to load fixture \"" + url + "\"."; } return value = loadComplete(url, xhr.getResponseHeader("content-type"), xhr.responseText, append, preload); }); return value; }; loadComplete = function(url, type, content, append, preload) { Teaspoon.fixture.cache[url] = { type: type, content: content }; if (type.match(/application\/json;/)) { return fixture.json[fixture.json.push(JSON.parse(content)) - 1]; } if (preload) { return content; } if (append) { addContent(content); } else { putContent(content); } return Teaspoon.fixture.el; }; set = function(content, append) { if (append) { return addContent(content); } else { return putContent(content); } }; putContent = function(content) { cleanup(); create(); return Teaspoon.fixture.el.innerHTML = content; }; addContent = function(content) { if (!Teaspoon.fixture.el) { create(); } return Teaspoon.fixture.el.innerHTML += content; }; create = function() { var _ref; Teaspoon.fixture.el = document.createElement("div"); if (typeof window.$ === 'function') { Teaspoon.fixture.$el = $(Teaspoon.fixture.el); } Teaspoon.fixture.el.id = "teaspoon-fixtures"; return (_ref = document.body) != null ? _ref.appendChild(Teaspoon.fixture.el) : void 0; }; cleanup = function() { var _base, _ref, _ref1; (_base = Teaspoon.fixture).el || (_base.el = document.getElementById("teaspoon-fixtures")); if ((_ref = Teaspoon.fixture.el) != null) { if ((_ref1 = _ref.parentNode) != null) { _ref1.removeChild(Teaspoon.fixture.el); } } return Teaspoon.fixture.el = null; }; xhrRequest = function(url, callback) { var e; if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch (_error) { e = _error; try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } catch (_error) { e = _error; } } } if (!xhr) { throw "Unable to make Ajax Request"; } xhr.onreadystatechange = callback; xhr.open("GET", "" + Teaspoon.root + "/fixtures/" + url, false); return xhr.send(); }; return fixture; }).call(this); }).call(this); (function() { Teaspoon.hook = function(name, options) { var xhr, xhrRequest; if (options == null) { options = {}; } xhr = null; xhrRequest = function(url, options, callback) { var e; if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch (_error) { e = _error; try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } catch (_error) { e = _error; } } } if (!xhr) { throw "Unable to make Ajax Request"; } xhr.onreadystatechange = callback; xhr.open(options['method'] || "GET", "" + Teaspoon.root + "/" + url, false); return xhr.send(options['payload']); }; return xhrRequest("" + Teaspoon.suites.active + "/" + name, options, function() { if (xhr.readyState !== 4) { return; } if (xhr.status !== 200) { throw "Unable to call hook \"" + url + "\"."; } }); }; }).call(this); (function() { Teaspoon.Reporters.BaseView = (function() { function BaseView() { this.elements = {}; this.build(); } BaseView.prototype.build = function(className) { return this.el = this.createEl("li", className); }; BaseView.prototype.appendTo = function(el) { return el.appendChild(this.el); }; BaseView.prototype.append = function(el) { return this.el.appendChild(el); }; BaseView.prototype.createEl = function(type, className) { var el; if (className == null) { className = ""; } el = document.createElement(type); el.className = className; return el; }; BaseView.prototype.findEl = function(id) { var _base; this.elements || (this.elements = {}); return (_base = this.elements)[id] || (_base[id] = document.getElementById("teaspoon-" + id)); }; BaseView.prototype.setText = function(id, value) { var el; el = this.findEl(id); return el.innerHTML = value; }; BaseView.prototype.setHtml = function(id, value, add) { var el; if (add == null) { add = false; } el = this.findEl(id); if (add) { return el.innerHTML += value; } else { return el.innerHTML = value; } }; BaseView.prototype.setClass = function(id, value) { var el; el = this.findEl(id); return el.className = value; }; BaseView.prototype.htmlSafe = function(str) { var el; el = document.createElement("div"); el.appendChild(document.createTextNode(str)); return el.innerHTML; }; return BaseView; })(); }).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; }; Teaspoon.Reporters.HTML = (function(_super) { __extends(HTML, _super); function HTML() { this.changeSuite = __bind(this.changeSuite, this); this.toggleConfig = __bind(this.toggleConfig, this); this.reportRunnerResults = __bind(this.reportRunnerResults, this); this.start = new Teaspoon.Date().getTime(); this.config = { "use-catch": true, "build-full-report": false, "display-progress": true }; this.total = { exist: 0, run: 0, passes: 0, failures: 0, skipped: 0 }; this.views = { specs: {}, suites: {} }; this.filters = []; this.setFilters(); this.readConfig(); HTML.__super__.constructor.apply(this, arguments); } HTML.prototype.build = function() { var _ref; this.buildLayout(); this.setText("env-info", this.envInfo()); this.setText("version", Teaspoon.version); this.findEl("toggles").onclick = this.toggleConfig; this.findEl("suites").innerHTML = this.buildSuiteSelect(); if ((_ref = this.findEl("suite-select")) != null) { _ref.onchange = this.changeSuite; } this.el = this.findEl("report-all"); this.showConfiguration(); this.buildProgress(); return this.buildFilters(); }; HTML.prototype.buildLayout = function() { var el; el = this.createEl("div"); el.id = "teaspoon-interface"; el.innerHTML = Teaspoon.Reporters.HTML.template(); return document.body.appendChild(el); }; HTML.prototype.buildSuiteSelect = function() { var filename, options, path, selected, suite, _i, _len, _ref; if (Teaspoon.suites.all.length === 1) { return ""; } filename = ""; if (/index\.html$/.test(window.location.pathname)) { filename = "/index.html"; } options = []; _ref = Teaspoon.suites.all; for (_i = 0, _len = _ref.length; _i < _len; _i++) { suite = _ref[_i]; path = [Teaspoon.root, suite].join("/"); selected = Teaspoon.suites.active === suite ? " selected" : ""; options.push(""); } return ""; }; HTML.prototype.buildProgress = function() { this.progress = Teaspoon.Reporters.HTML.ProgressView.create(this.config["display-progress"]); return this.progress.appendTo(this.findEl("progress")); }; HTML.prototype.buildFilters = function() { if (this.filters.length) { this.setClass("filter", "teaspoon-filtered"); } return this.setHtml("filter-list", "