Class: RSpec::CoverIt::PretestCoverage

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/cover_it/pretest_coverage.rb

Instance Method Summary collapse

Constructor Details

#initialize(filter:, results:) ⇒ PretestCoverage

Returns a new instance of PretestCoverage.



4
5
6
7
8
9
10
# File 'lib/rspec/cover_it/pretest_coverage.rb', line 4

def initialize(filter:, results:)
  @filter = filter
  @results = results
    .select { |k, _v| filter.nil? || k.start_with?(filter) }
    .map { |k, v| [k, v.dup] }
    .to_h
end

Instance Method Details

#[](path) ⇒ Object



12
13
14
# File 'lib/rspec/cover_it/pretest_coverage.rb', line 12

def [](path)
  @results[path]
end