{I" class:EFI"BundledAsset;FI"logical_path;FI",teaspoon/base/reporters/console_spec.js;TI" pathname;FI"d/Users/jejacks0n/Projects/teaspoon/spec/javascripts/teaspoon/base/reporters/console_spec.coffee;FI"content_type;FI"application/javascript;FI" mtime;Fl+Qú½QI" length;Fi¢I" digest;F"%ffa7ca1264775a1a60de290a2fd2c447I" source;FI"¢(function() { describe("Teaspoon.Reporters.Console", function() { beforeEach(function() { this.logSpy = spyOn(Teaspoon, "log"); spyOn(Date.prototype, "getTime").andReturn(666); this.spec = { fullDescription: "_spec_description_", description: "_spec_name_", suiteName: "_suite_name_", link: "?grep=_spec_description_", result: function() { return { status: "passed", skipped: false }; }, errors: function() { return [ { message: "_message_", trace: { stack: "_stack_" } } ]; }, getParents: function() { return [ { fullDescription: "_suite_full_description", description: "_suite_description_" } ]; } }; this.reporter = new Teaspoon.Reporters.Console(); this.reporter.spec = this.spec; return this.normalizeSpy = spyOn(Teaspoon, "Spec").andReturn(this.spec); }); describe("constructor", function() { return it("tracks failures, pending, total, and start time", function() { return expect(this.reporter.start).toBeDefined(); }); }); describe("#reportRunnerStarting", function() { return it("logs the information", function() { var spy; spy = spyOn(this.reporter, "log"); spyOn(JSON, 'parse').andReturn('_date_time_'); this.reporter.reportRunnerStarting({ total: 42 }); return expect(spy).toHaveBeenCalledWith({ type: "runner", total: 42, start: "_date_time_" }); }); }); describe("#reportSuites", function() { it("logs the information", function() { var spy; spy = spyOn(this.reporter, "log"); this.reporter.reportSuites(); return expect(spy).toHaveBeenCalledWith({ type: "suite", label: "_suite_description_", level: 0 }); }); return it("doesn't log the suite more than once.", function() { var spy; spy = spyOn(this.reporter, "log"); this.reporter.reportSuites(); this.reporter.reportSuites(); return expect(spy.callCount).toBe(1); }); }); describe("#reportSpecResults", function() { it("normalizes the spec", function() { this.reporter.reportSpecResults(); return expect(this.normalizeSpy).toHaveBeenCalled(); }); it("logs the information", function() { var spy; spy = spyOn(this.reporter, "log"); this.reporter.reportSpecResults(); return expect(spy).toHaveBeenCalledWith({ type: "spec", suite: "_suite_name_", label: "_spec_name_", status: "passed", skipped: false }); }); describe("pending tests", function() { beforeEach(function() { this.trackSpy = spyOn(this.reporter, "trackPending"); return this.spec.result = function() { return { status: "pending", skipped: false }; }; }); return it("tracks that it was pending", function() { this.reporter.reportSpecResults(); return expect(this.trackSpy).toHaveBeenCalled(); }); }); describe("skipped tests", function() { beforeEach(function() { this.reportSuitesSpy = spyOn(this.reporter, "reportSuites"); this.logSpy = spyOn(this.reporter, "log"); return this.spec.result = function() { return { status: "pending", skipped: true }; }; }); return it("doesn't report the suite or log the results", function() { this.reporter.reportSpecResults(); expect(this.reportSuitesSpy).not.toHaveBeenCalled(); return expect(this.logSpy).not.toHaveBeenCalled(); }); }); return describe("failing tests", function() { beforeEach(function() { this.trackSpy = spyOn(this.reporter, "trackFailure"); return this.spec.result = function() { return { status: "failed", skipped: false }; }; }); return it("tracks the failure", function() { this.reporter.reportSpecResults(); return expect(this.trackSpy).toHaveBeenCalled(); }); }); }); describe("#trackPending", function() { beforeEach(function() { this.reporter.spec = this.spec; return this.spec.result = function() { return { status: "pending", skipped: false }; }; }); return it("logs the status as 'pending'", function() { var spy; spy = spyOn(this.reporter, "log"); this.reporter.trackPending(); return expect(spy).toHaveBeenCalledWith({ type: "spec", suite: "_suite_name_", label: "_spec_name_", status: "pending", skipped: false }); }); }); describe("#trackFailure", function() { beforeEach(function() { this.reporter.spec = this.spec; return this.spec.result = function() { return { status: "failed", skipped: false }; }; }); return it("logs the status as 'failed'", function() { var spy; spy = spyOn(this.reporter, "log"); this.reporter.trackFailure(); return expect(spy).toHaveBeenCalledWith({ type: "spec", suite: "_suite_name_", label: "_spec_name_", status: "failed", skipped: false, link: "_spec_description_", message: "_message_", trace: "_message_" }); }); }); describe("#reportRunnerResults", function() { it("logs the results", function() { var args, spy; spy = spyOn(this.reporter, "log"); window.__coverage__ || (window.__coverage__ = {}); this.reporter.reportRunnerResults(); Teaspoon.finished = false; args = spy.mostRecentCall.args[0]; expect(args["type"]).toEqual("result"); expect(args["elapsed"]).toBeDefined(); return expect(args["coverage"]).toBe(window.__coverage__); }); return it("tells Teaspoon that we're finished", function() { this.reporter.reportRunnerResults(); expect(Teaspoon.finished).toEqual(true); return Teaspoon.finished = false; }); }); return describe("#log", function() { return it("logs the JSON of the object passed (with an additional _teaspoon property)", function() { this.reporter.log({ foo: true }); return expect(this.logSpy).toHaveBeenCalledWith('{"foo":true,"_teaspoon":true}'); }); }); }); }).call(this); ;TI"required_assets_digest;F"%916ff864ef00cbf303666447b5341dcfI" _version;F"%f9a10b06158d64a75654a1ef72ec0ff4