Class: RailsProof::TestCoveragePlan
- Inherits:
-
Object
- Object
- RailsProof::TestCoveragePlan
- Defined in:
- lib/rails_proof/test_coverage_plan.rb
Instance Attribute Summary collapse
-
#model_test_plan ⇒ Object
readonly
Returns the value of attribute model_test_plan.
-
#test_inspector ⇒ Object
readonly
Returns the value of attribute test_inspector.
Instance Method Summary collapse
- #covered_concerns ⇒ Object
- #covered_count ⇒ Object
-
#initialize(model_test_plan, test_inspector) ⇒ TestCoveragePlan
constructor
A new instance of TestCoveragePlan.
- #missing_concerns ⇒ Object
- #missing_count ⇒ Object
Constructor Details
#initialize(model_test_plan, test_inspector) ⇒ TestCoveragePlan
Returns a new instance of TestCoveragePlan.
5 6 7 8 |
# File 'lib/rails_proof/test_coverage_plan.rb', line 5 def initialize(model_test_plan, test_inspector) @model_test_plan = model_test_plan @test_inspector = test_inspector end |
Instance Attribute Details
#model_test_plan ⇒ Object (readonly)
Returns the value of attribute model_test_plan.
3 4 5 |
# File 'lib/rails_proof/test_coverage_plan.rb', line 3 def model_test_plan @model_test_plan end |
#test_inspector ⇒ Object (readonly)
Returns the value of attribute test_inspector.
3 4 5 |
# File 'lib/rails_proof/test_coverage_plan.rb', line 3 def test_inspector @test_inspector end |
Instance Method Details
#covered_concerns ⇒ Object
10 11 12 13 14 |
# File 'lib/rails_proof/test_coverage_plan.rb', line 10 def covered_concerns @covered_concerns ||= model_test_plan.concerns.select do |concern| covered?(concern) end end |
#covered_count ⇒ Object
22 23 24 |
# File 'lib/rails_proof/test_coverage_plan.rb', line 22 def covered_count covered_concerns.count end |
#missing_concerns ⇒ Object
16 17 18 19 20 |
# File 'lib/rails_proof/test_coverage_plan.rb', line 16 def missing_concerns @missing_concerns ||= model_test_plan.concerns.reject do |concern| covered?(concern) end end |
#missing_count ⇒ Object
26 27 28 |
# File 'lib/rails_proof/test_coverage_plan.rb', line 26 def missing_count missing_concerns.count end |