Class: RSpec::Coverage::Configuration
- Inherits:
-
Object
- Object
- RSpec::Coverage::Configuration
- Defined in:
- lib/rspec/coverage/configuration.rb
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Instance Method Summary collapse
-
#initialize(root) ⇒ Configuration
constructor
A new instance of Configuration.
- #start(*args, &block) ⇒ Object
Constructor Details
#initialize(root) ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 |
# 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 |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
4 5 6 |
# File 'lib/rspec/coverage/configuration.rb', line 4 def builder @builder end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
4 5 6 |
# File 'lib/rspec/coverage/configuration.rb', line 4 def root @root end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
4 5 6 |
# File 'lib/rspec/coverage/configuration.rb', line 4 def runner @runner end |
Instance Method Details
#start(*args, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# 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 |