Sha256: 1e3bc16674586286fa0ceb86b63de1cdab1abaabf16996c3e7003875347c5d1d

Contents?: true

Size: 865 Bytes

Versions: 1

Compression:

Stored size: 865 Bytes

Contents

class Teaspoon.Jasmine2.Spec

  constructor: (@spec) ->
    @fullDescription = @spec.fullName
    @description = @spec.description
    @link = "?grep=#{encodeURIComponent(@fullDescription)}"
    @parent = @spec.parent
    @suiteName = @parent.fullName
    @viewId = @spec.id
    @pending = @spec.status == "pending"


  errors: ->
    return [] unless @spec.failedExpectations.length
    for item in @spec.failedExpectations
      {message: item.message, stack: item.stack}


  getParents: ->
    return @parents if @parents
    @parents ||= []
    parent = @parent
    while parent
      parent = new Teaspoon.Jasmine2.Suite(parent)
      @parents.unshift(parent)
      parent = parent.parent
    @parents


  result: ->
    status: @status()
    skipped: @spec.status == "disabled"


  status: ->
    if @spec.status == "disabled" then "passed" else @spec.status

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
teaspoon-jasmine-2.2.0 lib/teaspoon/jasmine/assets/teaspoon/jasmine2/spec.coffee