Class: Klenod::Test::CoverageResult

Inherits:
Covered::Wrapper
  • Object
show all
Defined in:
lib/klenod/test/coverage.rb

Instance Method Summary collapse

Constructor Details

#initialize(output, context:, plugin:) ⇒ CoverageResult

Returns a new instance of CoverageResult.



12
13
14
15
16
17
18
# File 'lib/klenod/test/coverage.rb', line 12

def initialize(output, context:, plugin:)
  super(output)
  @modules_by_path = context.graph.mods.to_h do |module_id, mod|
    [File.expand_path(mod.eval_path), [module_id, mod]]
  end
  @plugin = plugin
end

Instance Method Details

#each ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/klenod/test/coverage.rb', line 20

def each
  return enum_for unless block_given?

  super do |coverage|
    mapped = map(coverage)
    yield mapped if mapped
  end
end