o: ActiveSupport::Cache::Entry	:@compressedF:@expires_in0:@created_atf1357839795.175241:@value"{I"
class:EFI"BundledAsset;�FI"logical_path;�FI"*teabag/base/reporters/console_spec.js;�FI"
pathname;�FI"`/Users/jejacks0n/Projects/teabag/spec/javascripts/teabag/base/reporters/console_spec.coffee;�FI"content_type;�FI"application/javascript;�FI"
mtime;�FI"2013-01-08T23:34:44-07:00;�FI"length;�FiI"digest;�F"%249f44f70143a865162e9d6a44644259I"source;�FI"(function() {

  describe("Teabag.Reporters.Console", function() {
    beforeEach(function() {
      this.logSpy = spyOn(Teabag, "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 Teabag.Reporters.Console();
      this.reporter.spec = this.spec;
      return this.normalizeSpy = spyOn(Teabag, "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");
        this.reporter.reportRunnerResults();
        Teabag.finished = false;
        args = spy.mostRecentCall.args[0];
        expect(args["type"]).toEqual("result");
        return expect(args["elapsed"]).toBeDefined();
      });
      return it("tells Teabag that we're finished", function() {
        this.reporter.reportRunnerResults();
        expect(Teabag.finished).toEqual(true);
        return Teabag.finished = false;
      });
    });
    return describe("#log", function() {
      return it("logs the JSON of the object passed (with an additional _teabag property)", function() {
        this.reporter.log({
          foo: true
        });
        return expect(this.logSpy).toHaveBeenCalledWith('{"foo":true,"_teabag":true}');
      });
    });
  });

}).call(this);
;�FI"required_assets_digest;�F"%815d01e95be7dfbadfeaea9961668d0cI"
_version;�F"%6776f581a4329e299531e1d52aa59832