lib/gitlab/qa/report/json_test_results.rb



# frozen_string_literal: true

require 'json'

module Gitlab
  module QA
    module Report
      class JsonTestResults
        include Enumerable

        def initialize(file)
          @testcases = JSON.parse(File.read(file))['examples'].map { |test| TestResult.from_json(test) }
        end

        def each(&block)
          @testcases.each(&block)
        end
      end
    end
  end
end