Class: RSpec::CoverIt::PretestCoverage
- Inherits:
-
Object
- Object
- RSpec::CoverIt::PretestCoverage
- Defined in:
- lib/rspec/cover_it/pretest_coverage.rb
Instance Method Summary collapse
- #[](path) ⇒ Object
-
#initialize(filter:, results:) ⇒ PretestCoverage
constructor
A new instance of PretestCoverage.
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 |