Sha256: 352418156d42012308e87cd672468aa1a8d9fba3ef82b08ced3b3f9e62b10fed

Contents?: true

Size: 608 Bytes

Versions: 6

Compression:

Stored size: 608 Bytes

Contents

module Teaspoon

  RESULT_ATTRS = [
    :type,
    :suite,
    :label,
    :status,
    :skipped,
    :link,
    :message,
    :trace,
    :elapsed,
    :total,
    :start,
    :level,
    :coverage
  ]

  class Result < Struct.new(*RESULT_ATTRS)

    def self.build_from_json(json)
      new(*RESULT_ATTRS.map{ |attr| json[attr.to_s] })
    end

    def description
      "#{suite} #{label}"
    end

    def failing?
      (status != "passed" && status != "pending") && type == "spec"
    end

    def passing?
      status == "passed"
    end

    def pending?
      status == "pending"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
teaspoon-0.7.9 lib/teaspoon/result.rb
teaspoon-0.7.8 lib/teaspoon/result.rb
teaspoon-0.7.7 lib/teaspoon/result.rb
teaspoon-0.7.6 lib/teaspoon/result.rb
teaspoon-0.7.5 lib/teaspoon/result.rb
teaspoon-0.7.4 lib/teaspoon/result.rb