Sha256: 004891b6300a191cd4b98950dddfe6f46bb61817535eaaf35a1755c89268862b

Contents?: true

Size: 856 Bytes

Versions: 19

Compression:

Stored size: 856 Bytes

Contents

describe "Mocha Teabag.Reporters.Console", ->

  beforeEach ->
    @runner = {on: @onSpy = sinon.spy()}
    @reportRunnerStartingSpy = Teabag.Reporters.Console.prototype.reportRunnerStarting = sinon.spy()
    @reporter = new Teabag.Reporters.Console(@runner)

  describe "constructor", ->

    it "calls reporterRunnerStarting", ->
      assert.calledOnce(@reportRunnerStartingSpy, "foo")

    it "registers for 'fail', 'test end', and 'end'", ->
      assert.calledWith(@onSpy, "fail", @reporter.reportSpecResults)
      assert.calledWith(@onSpy, "test end", @reporter.reportSpecResults)
      assert.calledWith(@onSpy, "end", @reporter.reportRunnerResults)


  describe "#reportSpecResults", ->

    it "sets the error if one is passed in", ->
      spec = {}
      @reporter.reportSpecResults(spec, foo: "bar")
      expect(spec.err).to.eql(foo: "bar")

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
teabag-0.7.3 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.7.2 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.7.1 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.7.0 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.6.0 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.5.5 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.5.4 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.5.3 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.5.2 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.5.1 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.5.0 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.4.6 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.4.5 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.4.4 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.4.3 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.4.2 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.4.1 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.4.0 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee
teabag-0.3.6 spec/javascripts/teabag/mocha/reporters/console_mspec.coffee