Class: Klenod::Test::CoverageRunner
- Inherits:
-
Object
- Object
- Klenod::Test::CoverageRunner
- Defined in:
- lib/klenod/test/coverage.rb
Constant Summary collapse
- REPORTS =
{ brief: Covered::BriefSummary, partial: Covered::PartialSummary, full: Covered::FullSummary, markdown: Covered::MarkdownSummary, quiet: Covered::Quiet }.freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(context:, plugin:, config:, output: $stdout) ⇒ CoverageRunner
constructor
A new instance of CoverageRunner.
Constructor Details
#initialize(context:, plugin:, config:, output: $stdout) ⇒ CoverageRunner
Returns a new instance of CoverageRunner.
72 73 74 75 76 77 |
# File 'lib/klenod/test/coverage.rb', line 72 def initialize(context:, plugin:, config:, output: $stdout) @context = context @plugin = plugin @config = config @output = output end |
Instance Method Details
#call ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/klenod/test/coverage.rb', line 79 def call policy = Covered::Policy.new policy.root(context.graph.source_dir.to_s) policy.start status = begin Integer(yield) ensure policy.finish end result = CoverageResult.new(policy, context:, plugin:) REPORTS.fetch(config.report).new.call(result, output) validate_minimum(result, status) end |