Sha256: 259755feff6345e95096323862b485219b79efef33be78f44859440ce2b42a22

Contents?: true

Size: 619 Bytes

Versions: 6

Compression:

Stored size: 619 Bytes

Contents

describe "Mocha Teabag.Runner", ->

  beforeEach ->
    @runSpy = mocha.run = sinon.spy()
    @runner = new Teabag.Runner()

  describe "constructor", ->

    it "calls run on the mocha env", ->
      @runner.setup = sinon.stub()
      assert.calledOnce(@runSpy)


  describe "#setup", ->

    it "adds the reporter to the env", ->
      spy = mocha.setup = sinon.spy()
      @runner.params = {grep: "foo"}
      @runner.setup()
      if navigator.userAgent.match(/PhantomJS/)
        assert.calledOnce(spy, reporter: Teabag.Reporters.Console)
      else
        assert.calledOnce(spy, reporter: Teabag.Reporters.HTML)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
teabag-0.3.5 spec/javascripts/teabag/mocha/runner_mspec.coffee
teabag-0.3.4 spec/javascripts/teabag/mocha/runner_mspec.coffee
teabag-0.3.3 spec/javascripts/teabag/mocha/runner_mspec.coffee
teabag-0.3.2 spec/javascripts/teabag/mocha/runner_mspec.coffee
teabag-0.3.1 spec/javascripts/teabag/mocha/runner_mspec.coffee
teabag-0.3.0 spec/javascripts/teabag/mocha/runner_mspec.coffee