class RSpec::Coverage::Excludes

Attributes

root[R]

Public Class Methods

new(root) click to toggle source
# File lib/rspec/coverage/excludes.rb, line 5
def initialize root
  @root, @overs = root, RSpec::Coverage::Result.new(root)
end

Public Instance Methods

record(before:, after:, mask: @overs.traverse! before, after, mask do |file,o,b,a,m| o ||= 0) click to toggle source
# File lib/rspec/coverage/excludes.rb, line 9
def record before:, after:, mask:
  @overs.traverse! before, after, mask do |file,o,b,a,m|
    o ||= 0
    b ||= 0
    a ||= 0
    m ||= mask[file] ? mask[file].last : INACTIVE

    if m == INACTIVE
      o + a - b
    else
      o
    end
  end