Class: SimcovAiFormatter::ResultsetLoader
- Inherits:
-
Object
- Object
- SimcovAiFormatter::ResultsetLoader
- Defined in:
- lib/simcov_ai_formatter/resultset_loader.rb
Overview
Loads SimpleCov’s .resultset.json, validates its shape, and returns the parsed Hash.
Expected shape:
{
"<suite_name>" => {
"coverage" => { "<abs_path>" => { "lines" => [...], "branches" => {...} } },
"timestamp" => Integer
},
...
}
Instance Method Summary collapse
-
#initialize(path) ⇒ ResultsetLoader
constructor
A new instance of ResultsetLoader.
- #load ⇒ Object
Constructor Details
#initialize(path) ⇒ ResultsetLoader
Returns a new instance of ResultsetLoader.
15 16 17 |
# File 'lib/simcov_ai_formatter/resultset_loader.rb', line 15 def initialize(path) @path = path end |
Instance Method Details
#load ⇒ Object
19 20 21 22 23 |
# File 'lib/simcov_ai_formatter/resultset_loader.rb', line 19 def load raw = read_json validate!(raw) raw end |