Class: TestMap::Report
- Inherits:
-
Object
- Object
- TestMap::Report
- Defined in:
- lib/test_map/report.rb
Overview
Report keeps track of associated files to test execution.
Instance Method Summary collapse
- #add(files) ⇒ Object
-
#initialize ⇒ Report
constructor
A new instance of Report.
- #results ⇒ Object
- #to_yaml ⇒ Object
- #write(file) ⇒ Object
Constructor Details
#initialize ⇒ Report
Returns a new instance of Report.
8 |
# File 'lib/test_map/report.rb', line 8 def initialize = @results = Hash.new { Set.new } |
Instance Method Details
#add(files) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/test_map/report.rb', line 10 def add(files) test_file, *associated_files = files TestMap.logger.info "Adding #{test_file} with #{associated_files}" associated_files.each do |file| @results[file] = @results[file] << test_file end end |
#results ⇒ Object
24 |
# File 'lib/test_map/report.rb', line 24 def results = @results.transform_values { _1.to_a.sort }.sort.to_h |
#to_yaml ⇒ Object
25 |
# File 'lib/test_map/report.rb', line 25 def to_yaml = results.to_yaml |