simple_cov_source_file.rb 682 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. # TODO: https://github.com/simplecov-ruby/simplecov/pull/1084
  3. # Patches this missing condition, monitor for upstream fix
  4. module SimpleCov
  5. module SourceFileExtensions
  6. def build_branches
  7. coverage_branch_data = coverage_data.fetch('branches', {}) || {} # Add the final empty hash in case where 'branches' is present, but returns nil
  8. branches = coverage_branch_data.flat_map do |condition, coverage_branches|
  9. build_branches_from(condition, coverage_branches)
  10. end
  11. process_skipped_branches(branches)
  12. end
  13. end
  14. end
  15. SimpleCov::SourceFile.prepend(SimpleCov::SourceFileExtensions) if defined?(SimpleCov::SourceFile)