o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1355470693.8335822:@value"L4{I" class:EFI"BundledAsset; FI"logical_path; FI""teabag/base/reporters_spec.js; TI" pathname; FI"X/Users/jejacks0n/Projects/teabag/spec/javascripts/teabag/base/reporters_spec.coffee; FI"content_type; FI"application/javascript; FI" mtime; FI"2012-12-14T00:13:06-07:00; FI"length; Fif2I"digest; F"%ff6410b8a2c3f62b2be7699960a06c27I"source; FI"f2(function() { describe("Teabag.Reporters.NormalizedSpec", function() { beforeEach(function() { var _this = this; this.jasmineSuite = { getFullName: function() { return "_full jasmine name_"; } }; this.jasmineSpecResultsItems = [ { message: "_jasmine_message1_", trace: { stack: "_jasmine_stack_trace1_" }, passed: function() { return false; } }, { message: "_jasmine_message2_", trace: { stack: "_jasmine_stack_trace2_" }, passed: function() { return false; } } ]; this.jasmineSpecResults = { skipped: false, passed: function() { return true; }, getItems: function() { return _this.jasmineSpecResultsItems; } }; this.jasmineSpec = { description: "_jasmine_description_", viewId: 42, pending: false, suite: this.jasmineSuite, getFullName: function() { return "_full jasmine description_"; }, results: function() { return _this.jasmineSpecResults; } }; this.mochaSuite = { fullTitle: function() { return "_full mocha name_"; } }; return this.mochaSpec = { title: "_mocha_description_", parent: this.mochaSuite, viewId: 420, pending: false, state: "passed", err: { message: "_mocha_message_", stack: "_mocha_stack_trace_" }, fullTitle: function() { return "_full mocha description_"; } }; }); describe("constructor", function() { describe("with jasmine type spec", function() { return it("has the expected properties", function() { var spec; spec = new Teabag.Reporters.NormalizedSpec(this.jasmineSpec); expect(spec.fullDescription).toEqual("_full jasmine description_"); expect(spec.description).toEqual("_jasmine_description_"); expect(spec.link).toEqual("?grep=_full%20jasmine%20description_"); expect(spec.parent).toBe(this.jasmineSuite); expect(spec.suiteName).toBe("_full jasmine name_"); expect(spec.viewId).toBe(42); return expect(spec.pending).toBe(false); }); }); return describe("with mocha type spec", function() { return it("has the expected properties", function() { var spec; spec = new Teabag.Reporters.NormalizedSpec(this.mochaSpec); expect(spec.fullDescription).toEqual("_full mocha description_"); expect(spec.description).toEqual("_mocha_description_"); expect(spec.link).toEqual("?grep=_full%20mocha%20description_"); expect(spec.parent).toBe(this.mochaSuite); expect(spec.suiteName).toBe("_full mocha name_"); expect(spec.viewId).toBe(420); return expect(spec.pending).toBe(false); }); }); }); describe("#errors", function() { describe("with jasmine type spec", function() { return it("returns the expected object", function() { var spec; spec = new Teabag.Reporters.NormalizedSpec(this.jasmineSpec); expect(spec.errors()).toEqual([ { message: "_jasmine_message1_", stack: "_jasmine_stack_trace1_" }, { message: "_jasmine_message2_", stack: "_jasmine_stack_trace2_" } ]); spyOn(this.jasmineSpecResultsItems[0], "passed").andReturn(true); spec = new Teabag.Reporters.NormalizedSpec(this.jasmineSpec); return expect(spec.errors()).toEqual([ { message: "_jasmine_message2_", stack: "_jasmine_stack_trace2_" } ]); }); }); return describe("with mocha type spec", function() { return it("returns the expected object", function() { var spec; spec = new Teabag.Reporters.NormalizedSpec(this.mochaSpec); return expect(spec.errors()).toEqual([ { message: "_mocha_message_", stack: "_mocha_stack_trace_" } ]); }); }); }); return describe("#results", function() { describe("with jasmine type spec", function() { describe("passing", function() { return it("returns the expected object", function() { var spec; spec = new Teabag.Reporters.NormalizedSpec(this.jasmineSpec); return expect(spec.result()).toEqual({ status: "passed", skipped: false }); }); }); describe("skipped", function() { return it("returns the expected object", function() { var spec; this.jasmineSpecResults.skipped = true; spec = new Teabag.Reporters.NormalizedSpec(this.jasmineSpec); return expect(spec.result()).toEqual({ status: "passed", skipped: true }); }); }); describe("pending", function() { return it("returns the expected object", function() { var spec; this.jasmineSpec.pending = true; spec = new Teabag.Reporters.NormalizedSpec(this.jasmineSpec); return expect(spec.result()).toEqual({ status: "pending", skipped: false }); }); }); return describe("failing", function() { return it("returns the expected object", function() { var spec; spyOn(this.jasmineSpecResults, "passed").andReturn(false); spec = new Teabag.Reporters.NormalizedSpec(this.jasmineSpec); return expect(spec.result()).toEqual({ status: "failed", skipped: false }); }); }); }); return describe("with mocha type spec", function() { describe("passing", function() { return it("returns the expected object", function() { var spec; spec = new Teabag.Reporters.NormalizedSpec(this.mochaSpec); return expect(spec.result()).toEqual({ status: "passed", skipped: false }); }); }); describe("skipped", function() { return it("returns the expected object", function() { var spec; this.mochaSpec.state = "skipped"; spec = new Teabag.Reporters.NormalizedSpec(this.mochaSpec); return expect(spec.result()).toEqual({ status: "passed", skipped: true }); }); }); describe("pending", function() { return it("returns the expected object", function() { var spec; this.mochaSpec.pending = true; spec = new Teabag.Reporters.NormalizedSpec(this.mochaSpec); return expect(spec.result()).toEqual({ status: "pending", skipped: false }); }); }); return describe("failing", function() { return it("returns the expected object", function() { var spec; this.mochaSpec.state = "failed"; spec = new Teabag.Reporters.NormalizedSpec(this.mochaSpec); return expect(spec.result()).toEqual({ status: "failed", skipped: false }); }); }); }); }); }); describe("Teabag.Reporters.NormalizedSuite", function() { beforeEach(function() { this.jasmineParentSuite = {}; this.jasmineSuite = { description: "_jasmine_description_", parentSuite: this.jasmineParentSuite, viewId: 42, getFullName: function() { return "_full jasmine description_"; } }; this.mochaParentSuite = { root: false }; return this.mochaSuite = { fullTitle: function() { return "_full mocha description_"; }, title: "_mocha_description_", viewId: 420, parent: this.mochaParentSuite }; }); return describe("constructor", function() { describe("with jasmine type suite", function() { return it("has the expected properties", function() { var suite; suite = new Teabag.Reporters.NormalizedSuite(this.jasmineSuite); expect(suite.fullDescription).toEqual("_full jasmine description_"); expect(suite.description).toEqual("_jasmine_description_"); expect(suite.link).toEqual("?grep=_full%20jasmine%20description_"); expect(suite.parent).toBe(this.jasmineParentSuite); return expect(suite.viewId).toBe(42); }); }); return describe("with mocha type suite", function() { return it("has the expected properties", function() { var suite; suite = new Teabag.Reporters.NormalizedSuite(this.mochaSuite); expect(suite.fullDescription).toEqual("_full mocha description_"); expect(suite.description).toEqual("_mocha_description_"); expect(suite.link).toEqual("?grep=_full%20mocha%20description_"); expect(suite.parent).toBe(this.mochaParentSuite); return expect(suite.viewId).toBe(420); }); }); }); }); describe("Teabag.Reporters.BaseView", function() { beforeEach(function() { return this.base = new Teabag.Reporters.BaseView(); }); describe("constructor", function() { return it("calls build", function() { var spy; spy = spyOn(Teabag.Reporters.BaseView.prototype, "build"); new Teabag.Reporters.BaseView(); return expect(spy).toHaveBeenCalled(); }); }); describe("#build", function() { return it("builds an element", function() { this.base.build("foo"); return expect(this.base.el.className).toBe("foo"); }); }); describe("#appendTo", function() { return it("calls appendChild on the passed element", function() { var el, spy; el = { appendChild: function() {} }; spy = spyOn(el, "appendChild"); this.base.appendTo(el); return expect(spy).toHaveBeenCalledWith(this.base.el); }); }); describe("#append", function() { return it("calls appendChild on our element", function() { var otherEl, spy; this.base.el = { appendChild: function() {} }; spy = spyOn(this.base.el, "appendChild"); otherEl = {}; this.base.append(otherEl); return expect(spy).toHaveBeenCalledWith(otherEl); }); }); describe("#createEl", function() { return it("creates an element with a className", function() { var el; el = this.base.createEl("em", "foo"); expect(el.tagName).toBe("EM"); return expect(el.className).toBe("foo"); }); }); describe("#findEl", function() { return it("finds an element and momoizes it", function() { this.base.findEl("controls"); return expect(this.base.elements["controls"]).toBeDefined(); }); }); describe("#setText", function() { return it("finds an el and sets it's innerText", function() { var el, spy; el = { innerText: "bar" }; spy = spyOn(this.base, "findEl").andReturn(el); this.base.setText("foo-id", "foo"); expect(spy).toHaveBeenCalledWith("foo-id"); return expect(el.innerText).toBe("foo"); }); }); describe("#setHtml", function() { return it("finds an el and sets it's innerHTML", function() { var el, spy; el = { innerHTML: "bar" }; spy = spyOn(this.base, "findEl").andReturn(el); this.base.setHtml("foo-id", "foo"); expect(spy).toHaveBeenCalledWith("foo-id"); return expect(el.innerHTML).toBe("foo"); }); }); describe("#setClass", function() { return it("finds an el and sets a class on it", function() { var el, spy; el = { className: "bar" }; spy = spyOn(this.base, "findEl").andReturn(el); this.base.setClass("foo-id", "foo"); expect(spy).toHaveBeenCalledWith("foo-id"); return expect(el.className).toBe("foo"); }); }); return describe("#htmlSafe", function() { return it("makes a string html safe", function() { return expect(this.base.htmlSafe("
")).toEqual("<div></div>"); }); }); }); }).call(this); ; FI"required_assets_digest; F"%1e6348515c3b840296c077816b92b5f7I" _version; F"%6776f581a4329e299531e1d52aa59832