Class: SimpleCovMcp::ResultsetLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov_mcp/resultset_loader.rb

Defined Under Namespace

Classes: Result, SuiteEntry

Class Method Summary collapse

Class Method Details

.load(resultset_path:) ⇒ Object

Raises:



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/simplecov_mcp/resultset_loader.rb', line 15

def load(resultset_path:)
  raw = JSON.load_file(resultset_path)


  suites = extract_suite_entries(raw, resultset_path)
  raise CoverageDataError, "No test suite with coverage data found in resultset file: #{resultset_path}" if suites.empty?

  coverage_map = build_coverage_map(suites, resultset_path)
  Result.new(
    coverage_map: coverage_map,
    timestamp: compute_combined_timestamp(suites),
    suite_names: suites.map(&:name)
  )
end