class RSpec::Coverage::Configuration

Attributes

builder[R]
root[R]
runner[R]

Public Class Methods

new(root) click to toggle source
# File lib/rspec/coverage/configuration.rb, line 6
def initialize root
  @root    = root
  map      = ClassMap.new root
  @builder = ClassMapBuilder.new map
  @runner  = Runner.new map
end

Public Instance Methods

start(*args, &block) click to toggle source
# File lib/rspec/coverage/configuration.rb, line 13
def start *args, &block
  @builder.enable

  SimpleCov.start(*args, &block)
  SimpleCov.at_exit do
    SimpleCov.formatter.new.format SimpleCov::Result.new runner.result
  end

  _self = self
  RSpec.configure do |c|
    c.around :each do |example|
      _self.runner.call example
    end
  end
end