Sha256: 75ef6011ff4ef38d9854161e595b9c316688bb66aa5f7620ae0c5dc8949bea85

Contents?: true

Size: 791 Bytes

Versions: 13

Compression:

Stored size: 791 Bytes

Contents

class Teaspoon.Runner

  @run: false

  constructor: ->
    return if @constructor.run
    @constructor.run = true
    @fixturePath = "#{Teaspoon.root}/fixtures"
    @params = Teaspoon.params = @getParams()
    @setup()


  getParams: ->
    params = {}
    for param in Teaspoon.location.search.substring(1).split("&")
      [name, value] = param.split("=")
      params[decodeURIComponent(name)] = decodeURIComponent(value)
    params


  getReporter: ->
    if @params["reporter"]
      @findReporter(@params["reporter"])
    else
      if window.navigator.userAgent.match(/PhantomJS/)
        @findReporter("Console")
      else
        @findReporter("HTML")


  setup: ->
    # left for subclasses to implement


  findReporter: (type) ->
    Teaspoon.resolveClass("Reporters.#{type}")

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
teaspoon-1.4.0 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.2.2 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.2.1 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.2.0 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.1.5 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.1.4 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.1.3 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.1.2 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.1.1 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.1.0 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.0.2 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.0.1 app/assets/javascripts/teaspoon/runner.coffee
teaspoon-1.0.0 app/assets/javascripts/teaspoon/runner.coffee