Sha256: 32b668f4962b5333e406ec83150bd57c7308ac307ccde6a724e98c969cf450fe

Contents?: true

Size: 628 Bytes

Versions: 15

Compression:

Stored size: 628 Bytes

Contents

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

  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

15 entries across 15 versions & 1 rubygems

Version Path
teaspoon-1.4.0 lib/teaspoon/result.rb
teaspoon-1.2.2 lib/teaspoon/result.rb
teaspoon-1.2.1 lib/teaspoon/result.rb
teaspoon-1.2.0 lib/teaspoon/result.rb
teaspoon-1.1.5 lib/teaspoon/result.rb
teaspoon-1.1.4 lib/teaspoon/result.rb
teaspoon-1.1.3 lib/teaspoon/result.rb
teaspoon-1.1.2 lib/teaspoon/result.rb
teaspoon-1.1.1 lib/teaspoon/result.rb
teaspoon-1.1.0 lib/teaspoon/result.rb
teaspoon-1.0.2 lib/teaspoon/result.rb
teaspoon-1.0.1 lib/teaspoon/result.rb
teaspoon-1.0.0 lib/teaspoon/result.rb
teaspoon-0.9.1 lib/teaspoon/result.rb
teaspoon-0.9.0 lib/teaspoon/result.rb