Sha256: 78ef6f30743424d843c0abdda781a7875c92384c0aacd1af082b3f81e205caa7

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

class Teaspoon.Jasmine2.Responder

  constructor: (@reporter) ->

  
  jasmineStarted: (runner) ->
    @reporter.reportRunnerStarting(total: runner.totalSpecsDefined)

  
  jasmineDone: ->
    @reporter.reportRunnerResults()


  suiteStarted: (suite) ->
    if @currentSuite # suite already running, we're nested
      suite.parent = @currentSuite
    @currentSuite = suite

    @reporter.reportSuiteStarting(new Teaspoon.Jasmine2.Suite(suite))


  suiteDone: (suite) ->
    @currentSuite = @currentSuite.parent

    @reporter.reportSuiteResults(new Teaspoon.Jasmine2.Suite(suite))


  specStarted: (spec) ->
    # Jasmine 2 reports the spec starting even though it may
    # be filtered out, but there's no way to tell.
    # TODO: Is there a way to clean this up?
    if jasmine.getEnv().specFilter(getFullName: -> spec.fullName)
      spec.parent = @currentSuite
      @reporter.reportSpecStarting(new Teaspoon.Jasmine2.Spec(spec))


  specDone: (spec) ->
    spec.parent = @currentSuite
    @reporter.reportSpecResults(new Teaspoon.Jasmine2.Spec(spec))

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
teaspoon-jasmine-2.9.1 lib/teaspoon/jasmine/assets/teaspoon/jasmine2/responder.coffee
teaspoon-jasmine-2.4.1 lib/teaspoon/jasmine/assets/teaspoon/jasmine2/responder.coffee
teaspoon-jasmine-2.3.4 lib/teaspoon/jasmine/assets/teaspoon/jasmine2/responder.coffee
teaspoon-jasmine-2.2.0 lib/teaspoon/jasmine/assets/teaspoon/jasmine2/responder.coffee