Sha256: 5ed02ab6302777a55aed04d97be0a40efd994977e49fa3166d64ce101515c05f

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

describe "Teabag.Runner", ->

  beforeEach ->
    spyOn(jasmine.getEnv(), "execute")
    Teabag.Runner.run = false # reset this so we can use it
    @setupSpy = spyOn(Teabag.Runner.prototype, "setup")

  describe "constructor", ->

    it "calls setup", ->
      new Teabag.Runner()
      expect(@setupSpy).toHaveBeenCalled()

    it "sets Teabag.Runner.run to true", ->
      new Teabag.Runner()
      expect(Teabag.Runner.run).toEqual(true)

    it "sets @fixturePath to whatever was in Teabag.fixturePath", ->
      Teabag.fixturePath = "/path/to/fixtures"
      runner = new Teabag.Runner()
      expect(runner.fixturePath).toEqual("/path/to/fixtures")

    it "doesn't call setup if already run", ->
      Teabag.Runner.run = true
      new Teabag.Runner()
      expect(@setupSpy).wasNotCalled()


  describe "#getParams", ->

    it "gets the params out of the window.location.search", ->
      spyOn(String.prototype, "substring").andReturn("grep=foo&bar=baz")
      runner = new Teabag.Runner()
      expect(runner.params).toEqual(grep: "foo", bar: "baz")

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
teabag-0.3.5 spec/javascripts/teabag/base/runner_spec.coffee
teabag-0.3.4 spec/javascripts/teabag/base/runner_spec.coffee
teabag-0.3.3 spec/javascripts/teabag/base/runner_spec.coffee
teabag-0.3.2 spec/javascripts/teabag/base/runner_spec.coffee
teabag-0.3.1 spec/javascripts/teabag/base/runner_spec.coffee
teabag-0.3.0 spec/javascripts/teabag/base/runner_spec.coffee