Sha256: 881b4ed16fe619401a04266fdf8bd4761f415ab1dc51c2f6ec456aedca6943a4

Contents?: true

Size: 725 Bytes

Versions: 9

Compression:

Stored size: 725 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"]
      Teaspoon.Reporters[@params["reporter"]]
    else
      if window.navigator.userAgent.match(/PhantomJS/)
        Teaspoon.Reporters.Console
      else
        Teaspoon.Reporters.HTML


  setup: ->
    # left for subclasses to implement

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
teaspoon-0.9.1 app/assets/javascripts/teaspoon/base/runner.coffee
teaspoon-0.9.0 app/assets/javascripts/teaspoon/base/runner.coffee
teaspoon-0.8.0 app/assets/javascripts/teaspoon/base/runner.coffee
teaspoon-0.7.9 app/assets/javascripts/teaspoon/base/runner.coffee
teaspoon-0.7.8 app/assets/javascripts/teaspoon/base/runner.coffee
teaspoon-0.7.7 app/assets/javascripts/teaspoon/base/runner.coffee
teaspoon-0.7.6 app/assets/javascripts/teaspoon/base/runner.coffee
teaspoon-0.7.5 app/assets/javascripts/teaspoon/base/runner.coffee
teaspoon-0.7.4 app/assets/javascripts/teaspoon/base/runner.coffee