Sha256: 73bf127adc794b96689f4de69e03e0c83d30671868ea42884569f0f8c949838f

Contents?: true

Size: 753 Bytes

Versions: 14

Compression:

Stored size: 753 Bytes

Contents

module Teabag
  class Result < Struct.new(:type, :suite, :label, :status, :skipped, :link, :message, :trace, :elapsed, :total, :start, :level)

    def self.build_from_json(json)
      new json["type"],
          json["suite"],
          json["label"],
          json["status"],
          json["skipped"],
          json["link"],
          json["message"],
          json["trace"],
          json["elapsed"],
          json["total"],
          json["start"],
          json["level"]
    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

14 entries across 14 versions & 1 rubygems

Version Path
teabag-0.5.5 lib/teabag/result.rb
teabag-0.5.4 lib/teabag/result.rb
teabag-0.5.3 lib/teabag/result.rb
teabag-0.5.2 lib/teabag/result.rb
teabag-0.5.1 lib/teabag/result.rb
teabag-0.5.0 lib/teabag/result.rb
teabag-0.4.6 lib/teabag/result.rb
teabag-0.4.5 lib/teabag/result.rb
teabag-0.4.4 lib/teabag/result.rb
teabag-0.4.3 lib/teabag/result.rb
teabag-0.4.2 lib/teabag/result.rb
teabag-0.4.1 lib/teabag/result.rb
teabag-0.4.0 lib/teabag/result.rb
teabag-0.3.6 lib/teabag/result.rb