Module: CucumberFM::FeatureElement::Component::TotalEstimation
- Included in:
- Aggregator::Collection, Aggregator::ScenarioCollection, CucumberFM::Feature, CucumberFeatureManager
- Defined in:
- lib/cucumber_f_m/feature_element/component/total_estimation.rb
Instance Method Summary collapse
- #estimation ⇒ Object
- #estimation_done ⇒ Object
- #estimation_done_percentage ⇒ Object
- #scenarios_done ⇒ Object
- #scenarios_done_percentage ⇒ Object
Instance Method Details
#estimation ⇒ Object
5 6 7 |
# File 'lib/cucumber_f_m/feature_element/component/total_estimation.rb', line 5 def estimation scenarios.inject(0.0) { |sum, scenario| sum + scenario.estimation } end |
#estimation_done ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/cucumber_f_m/feature_element/component/total_estimation.rb', line 9 def estimation_done scenarios.inject(0.0) do |sum, scenario| estimation_done_filter.pass?(scenario.) ? sum + scenario.estimation : sum end end |
#estimation_done_percentage ⇒ Object
17 18 19 |
# File 'lib/cucumber_f_m/feature_element/component/total_estimation.rb', line 17 def estimation_done_percentage estimation > 0 ? ( estimation_done.to_f / estimation * 100 ).round : 0 end |
#scenarios_done ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/cucumber_f_m/feature_element/component/total_estimation.rb', line 21 def scenarios_done scenarios.inject(0) do |sum, scenario| estimation_done_filter.pass?(scenario.) ? sum + 1 : sum end end |
#scenarios_done_percentage ⇒ Object
29 30 31 |
# File 'lib/cucumber_f_m/feature_element/component/total_estimation.rb', line 29 def scenarios_done_percentage !scenarios.empty? ? ( scenarios_done.to_f / scenarios.size * 100 ).round : 0 end |